In some cases, if you have already built a functioning subscription system, it may not be possible or feasible to use the Purchases SDK to make purchases. However, you can still use the SDK to get access to the advanced charting, webhooks, and attribution that RevenueCat can provide.
By simply setting up and instantiating an instance of Purchases in "Observer Mode", receipts can be recorded and stored in the RevenueCat backend without interfering with any of your existing code. On iOS, receipts can be recorded automatically, on Android, use
syncPurchases after purchases and restores to record receipts in RevenueCat.
Google Play Billing Library: 2.0+ (Android only)
No special requirements
Older versions of Google Play Billing Library are supported in version 2.4.1 or the Android SDK
Purchases.configure( withAPIKey: "my_api_key", appUserID: "my_app_user_id", observerMode: true)
[RCPurchases configureWithAPIKey:@"my_api_key" appUserID:@"my_app_user_id" observerMode: YES];
Purchases.configure(this, "my_api_key", "my_app_user_id", true)
Purchases.configure(this, "my_api_key", "my_app_user_id", true);
await Purchases.setup("my_api_key", observerMode: true);
See "Enable Observer Mode in Unity configuration" below
Important (Android only)
On Android, RevenueCat won't consume or acknowledge any purchase in Observer Mode so be sure your app is handling that. Failure to do so will result in your purchases being refunded after 3 days.
Important note regarding InAppBillingService (Android Unity only)
If using RevenueCat alongside Unity IAP or other plugin that includes the Android InAppBillingService class, follow this instructions
On Android (or cross-platform SDKs), any time a purchase or restore occurs in your app you should call the
syncPurchases method to record it in RevenueCat.
// Called any time a purchase or restore // is successful in your existing code Purchases.sharedInstance.syncPurchases()
// Called any time a purchase or restore // is successful in your existing code Purchases.getSharedInstance().syncPurchases();
// Called any time a purchase or restore // is successful in your existing code Purchases.syncPurchases();
Failing to call
syncPurchasesafter purchases and restores in Observer Mode will prevent any transactions from being recorded.
You've done it!
That's all there is to it to enable RevenueCat in your app! There are certain features, like entitlements, that can only be enabled with a deeper SDK integration. When the that time comes, head back to our Quickstart guide to get set up.
Updated 22 days ago