Android setup

Add the PurchaseKit library to your Android app and register the bridge component.

Installation

Add JitPack repository

Add JitPack to your project's settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

Add the dependency

Add PurchaseKit to your app's build.gradle.kts:

dependencies {
    implementation("com.github.purchasekit:purchasekit-android:0.1.0")
}

Register the bridge component

In your Application class, register the PaywallComponent:

import android.app.Application
import dev.hotwire.core.bridge.BridgeComponentFactory
import dev.hotwire.core.bridge.KotlinXJsonConverter
import dev.hotwire.core.config.Hotwire
import dev.hotwire.navigation.config.registerBridgeComponents
import dev.purchasekit.android.PaywallComponent

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        Hotwire.registerBridgeComponents(
            BridgeComponentFactory("paywall", ::PaywallComponent)
        )

        Hotwire.config.jsonConverter = KotlinXJsonConverter()
    }
}

The component name "paywall" must match the name used in your web app's JavaScript.

How it works

When your web paywall loads, it sends a prices message to the native app. PurchaseKit fetches localized prices from Google Play and returns them to the web.

When the user taps Subscribe, your web app sends a purchase message with:
- googleStoreProductId - The product ID from Google Play Console
- correlationId - A UUID that links this purchase to your PurchaseKit Purchase Intent

PurchaseKit launches the Google Play purchase flow and returns the result.

Testing

License testers

Add your test accounts to Play Console → Setup → License testing. License testers can make purchases without being charged.

Internal testing

For full end-to-end testing:

  1. Create an internal testing track in Play Console
  2. Upload your APK or AAB
  3. Add testers and share the opt-in link
  4. Testers install via the Play Store

Next step

Create your subscriptions in Google Play Console.