Initialization API

The RevTwo library needs to know its identity before it can get started. From the Support Portal you create your App’s Model and that page has the code snippet to use here.

Product Key & Secret Key

In RevTwo support, you configure each product independently, and each has its own product key and secret key.  The product key identifies which product this is, while the secret key is used to sign messages to ensure the integrity of the sender. Protect these keys!

Different apps should always have their own product configuration.

App Mode

RevTwo has three different modes you can run an app in.  Learn more about setting your app mode here. The modes are: R2MODE_DEVELOPMENT, R2MODE_TESTFLIGHT, and R2MODE_PRODUCTION.

Initialize Your App

Add the following code to onCreate method in your application or first activity class (the actual initialize parameters come from the App Model you created in the support portal):

import com.revtwo.revtwolib.RevTwo;
import com.revtwo.revtwolibmodels.callback.Callback;
import com.revtwo.revtwolibmodels.enumerations.ModeEnum;
...
RevTwo.initialize(“ADD YOUR KEY HERE", “ADD YOUR PRIVATE KEY HERE", ModeEnum.R2MODE_DEVELOPMENT, true, this, new Callback<Void>() {
   @Override
   public void onSuccess(Void param) {
      super.onSuccess(param);
      // Your code here
   }
   @Override
   public void onError(Throwable t) {
      super.onError(t);
      // Error handling
   }
});
  • Setting 4th parameter to true will enable calling in community mode.
  • Setting it to false will hide the call icon in community view and disabled calling.