Android

Instructions for installing Purchases SDK for Android

What is RevenueCat?

RevenueCat provides a backend and a wrapper around StoreKit and Google Play Billing to make implementing in-app purchases and subscriptions easy. With our SDK, you can build and manage your app business on any platform without having to maintain IAP infrastructure. You can read more about how RevenueCat fits into your app or you can sign up free to start building.

Android

Installation

Purchases for Android (Google Play and Amazon Appstore) is available on Maven and can be included via Gradle.

Release

implementation 'com.revenuecat.purchases:purchases:5.4.0'

🚧

Billing Client 5 Unsupported

We're working on updating our SDKs for compatibility with Billing Client 5.0. See this community thread for updates. For now, RevenueCat is only compatible with Billing Client 4.0.

Import Purchases

You should now be able to import Purchases.

import com.android.billingclient.api.SkuDetails;
import com.revenuecat.purchases.Entitlement;
import com.revenuecat.purchases.Offering;
import com.revenuecat.purchases.PurchaserInfo;
import com.revenuecat.purchases.Purchases;

Configure Proguard

You should add -keep class com.revenuecat.purchases.** { *; } to your Proguard configuration.

Amazon

Additional Dependencies

Add a new dependency to the build.gradle apart from the regular purchases dependency. These new dependencies have the classes needed to use Amazon IAP:

implementation 'com.revenuecat.purchases:purchases:5.4.0'
implementation 'com.revenuecat.purchases:purchases-store-amazon:5.4.0'

Add Amazon public key

Adding support for Amazon requires adding a .pem public key to your project. You can configure this key by following Amazon's guide here.

Due to some limitations, RevenueCat will only validate purchases made in production or in Live App Testing and won't validate purchases made with the Amazon App Tester.

Next Steps