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.

Enable Calling

Setting the enable call parameter to NO will disable the in-app call feature.

Initialize Your App

The initialize call goes in your app’s UIApplicationDelegate‘s DidFinishLaunchingWithOptions method. Just paste the code from the Portal’s Model.

void R2Initialize(NSString *productKey, NSString *secretKey, int mode, BOOL enableCalling);

Objective-C

#import "RevTwo.h"
...
R2Initialize(@"13AE08B4-A51A-5A4D-4319-17C41F3D4D2A", @"WPZ3BnSstrfXg2Txwyvch6vK5", R2MODE_DEVELOPMENT, YES);

Swift

R2Initialize("13AE08B4-A51A-5A4D-4319-17C41F3D4D2A", "WPZ3BnSstrfXg2Txwyvch6vK5", R2MODE_DEVELOPMENT, YES)