SDK

Android in-app subscriptions with Google Play Billing and the RevenueDot SDK

To add Android in-app subscriptions, add app.revenuedot.purchases:purchases:10.23.3 to Gradle and configure the RevenueDot SDK with your app's goog_ key in Application.onCreate(). RevenueDot reads each purchase from the Google Play Developer API, acknowledges it and keeps each customer's access in sync through real-time developer notifications. RevenueDot Cloud is free until your app makes $10,000 a month.

Free until your app makes $10,000 a month. Switching from RevenueCat? Change one line.

One Gradle line

app.revenuedot.purchases:purchases:10.23.3 from Maven Central, plus purchases-ui for paywalls.

Google Play checked server-side

RevenueDot reads each purchase token from the Play Developer API and acknowledges it.

Test Store first

Buy with a test_ key in a debug build before you have a Google Play account.

Every request to RevenueDot

The SDK sends purchases, diagnostics, paywall events and ad events to RevenueDot.

Steps

How to add subscriptions to an Android app with RevenueDot

  1. 01

    Create a free Cloud project and a Google Play app

    Start for free on RevenueDot Cloud and add a Google Play app with your package name. Copy its goog_ public key.

  2. 02

    Connect Google Play

    Upload a service account key and add a Pub/Sub push subscription for real-time developer notifications. See Google Play setup.

  3. 03

    Create your catalog

    Add products with store_identifier as subscriptionId:basePlanId, an entitlement such as pro (the access your app checks) and a current offering (the products your paywall shows).

  4. 04

    Install the RevenueDot SDK and configure it with your key

    Add the Gradle dependency and call Purchases.configure in Application.onCreate(), as in the code below. On Cloud the SDK already points at RevenueDot, so your key is the only setting.

  5. 05

    Buy and check the entitlement

    Call awaitPurchase and read customerInfo.entitlements["pro"]?.isActive. RevenueDot checks the purchase token with Google and updates the customer's access.

  6. 06

    Test with the Test Store or a test track

    Use a test_ key in a debug build, or a Play license tester on an internal test track. See the Test Store.

Install

Install the RevenueDot Android SDK and configure it with your key

The RevenueDot SDK is built from RevenueCat's open-source SDK (MIT license), so your code imports com.revenuecat.purchases and calls Purchases. It sends every request to RevenueDot and needs no RevenueCat account.

Self-hosting? Set Purchases.proxyURL to your server before configure, and configure with EntitlementVerificationMode.DISABLED, because your server signs with its own key. The Android emulator reaches your computer at http://10.0.2.2:8787, and plain http needs a network security config that allows cleartext traffic to that host. See Trusted Entitlements.

Install, then configure in Application.onCreate()Gradle and Kotlin
// build.gradle.kts
implementation("app.revenuedot.purchases:purchases:10.23.3")
implementation("app.revenuedot.purchases:purchases-ui:10.23.3")   // only for paywalls

// MainApplication.kt
import com.revenuecat.purchases.Purchases
import com.revenuecat.purchases.PurchasesConfiguration

class MainApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Purchases.configure(PurchasesConfiguration.Builder(this, "goog_...").build())
    }
}

Kotlin

Check the entitlement, then buy a package

Check access and buy with the coroutine helpersKotlin
val customerInfo = Purchases.sharedInstance.awaitCustomerInfo()
val isPro = customerInfo.entitlements["pro"]?.isActive == true

val offerings = Purchases.sharedInstance.awaitOfferings()
val pkg = offerings.current?.availablePackages?.firstOrNull() ?: return
try {
    val result = Purchases.sharedInstance.awaitPurchase(PurchaseParams.Builder(activity, pkg).build())
    val nowPro = result.customerInfo.entitlements["pro"]?.isActive == true
} catch (e: PurchasesTransactionException) {
    if (e.userCancelled) return
}

Notes

Check these Android details before you ship

  • Test Store keys work in debug builds only. A release build shows an error screen and stops on purpose. Ship with your goog_ key.
  • Amazon: the same SDK runs on Fire devices with AmazonConfiguration. See Amazon Appstore setup.
  • Web purchases: an intent filter for your redemption scheme plus redeemWebPurchase gives buyers from a RevenueDot purchase link access in the app.
  • Before you ship: run a purchase with a license tester and check it on the customer page.

Switch

Switching from RevenueCat? Keep your Kotlin SDK and change one line

If your app already ships the RevenueCat Android SDK, you can keep it. Set Purchases.proxyURL to RevenueDot before configure and turn entitlement verification off. Then call syncPurchases() once on the first launch of the update, so current subscribers keep access. The full plan is in Migrate from RevenueCat.

  • Verification: set DISABLED. The default, INFORMATIONAL, logs every RevenueDot response as a failed signature check. Never use ENFORCED with the stock SDK: every request would fail.
  • Diagnostics: the stock SDK still sends diagnostics, paywall events and ad events to RevenueCat's hosts. The RevenueDot SDK sends them to RevenueDot.
  • Purchase tokens: syncPurchases() also gives RevenueDot any Google purchase token the importer could not find.
  • Tested: the unmodified RevenueCat Android SDK 10.24.0 passes a Test Store purchase against RevenueDot on an Android 15 emulator.
Point the RevenueCat SDK at RevenueDotKotlin
// Before Purchases.configure
Purchases.proxyURL = URL("https://api.revenuedot.app")
Purchases.configure(
    PurchasesConfiguration.Builder(this, "goog_...")
        // Default is INFORMATIONAL, which logs every response as a failed signature check.
        .entitlementVerificationMode(EntitlementVerificationMode.DISABLED)
        .build()
)

// Once, on the first launch of this update
Purchases.sharedInstance.syncPurchases()

FAQ

Android: questions people ask

Do I need a RevenueCat account to use the RevenueDot Android SDK?

No. The RevenueDot SDK is built from RevenueCat's open-source Android SDK under the MIT license, but every request goes to RevenueDot. Create a free RevenueDot Cloud project, copy your app's goog_ key and pass it to Purchases.configure.

How do I add in-app subscriptions to an Android app with Google Play Billing?

Add app.revenuedot.purchases:purchases to Gradle, configure it with your goog_ key, fetch offerings and call awaitPurchase. RevenueDot checks each purchase token with the Google Play Developer API, using the service account and Pub/Sub push subscription you add to the app.

Do I need to acknowledge Google Play purchases myself?

No. RevenueDot acknowledges each purchase after reading it from the Play Developer API, because Google refunds purchases left unacknowledged for 3 days.

How do Google Play base plans map to RevenueDot products?

Set the product's store_identifier to subscriptionId:basePlanId, for example pro:monthly. Use the product ID for one-time products.

How do I test Android purchases without Play Console?

Create a Test Store app, use its test_ key in a debug build and tap the successful purchase in the SDK's dialog. For real Google test purchases, add license testers and use an internal test track.

I already ship the RevenueCat Android SDK. What changes?

Set Purchases.proxyURL before configure, set verification to DISABLED and call syncPurchases() once after the update. Purchases, customer info and offerings then go to RevenueDot. The stock SDK still sends diagnostics to RevenueCat, and the RevenueDot SDK does not.

Get started

Start selling subscriptions in your app today.

Building and testing are free, and you can test your first purchase before you have a store account. Pro costs $0 until your apps make $10,000 a month.

Already have an account? Sign in · Switching from RevenueCat? Change one line