Skip to main content

Integrating Customer Center on Kotlin Multiplatform

Overviewโ€‹

Customer Center is a self-service UI that can be added to your app to help your customers manage their subscriptions on their own. With it, you can prevent churn with pre-emptive promotional offers, capture actionable customer data with exit feedback prompts, and lower support volumes for common inquiries โ€” all without any help from your support team.

There are only three steps to integrate Customer Center in your app:

  1. Installing the RevenueCat UI SDK in your app
  2. Implementing the Customer Center view in your app
  3. Setting up promotional offers in App Store Connect/Google Play Console

Installationโ€‹

CustomerCenter for Kotlin Multiplatform is available on Maven Central and can be included via Gradle starting at 1.7.0.

Release

Add the following Maven coordinates to your libs.versions.toml:

[versions] 
purchases-kmp = "<version>"

[libraries]
purchases-core = { module = "com.revenuecat.purchases:purchases-kmp-core", version.ref = "<version>" }
purchases-ui = { module = "com.revenuecat.purchases:purchases-kmp-ui", version.ref = "<version>" }

Then add the dependencies to the commonMain sourceset in your Compose Multiplatform module's build.gradle.kts:

kotlin {
// ...
sourceSets {
// ...
commonMain.dependencies {
// Add the purchases-kmp dependencies.
implementation(libs.purchases.core)
implementation(libs.purchases.ui)
}
}
}

Lastly, you'll need to make sure you link the PurchasesHybridCommonUI native iOS framework. If your iOS app uses Swift Package Manager, add the PurchasesHybridCommonUI library to your target in the same way you added the PurchasesHybridCommon library. If your iOS app uses CocoaPods, either update its Podfile, or update your Compose Multiplatform module's build.gradle.kts, depending on how your Multiplatform module is integrated with your iOS project.

Integrationโ€‹

Opening the customer center is as simple as:

CustomerCenter(
onDismiss = {
// handle dismiss gracefully
},
)

Setup promotional offersโ€‹

Promotional Offers allow developers to apply custom pricing and trials to new customers and to existing and lapsed subscriptions. Unique promotional offers can be assigned to different paths and survey responses in the Customer Center, but first they must be setup in App Store Connect and Google Play Store.

The Customer Center will automatically show offers based on specific user actions. By default we have defined it for cancellations but it can be modified to any of the defined paths. For React Native you are going to have to configure these promotional offers in both Google Play Console and App Store Connect. Refer to configuring Google Play Store promotional offers and configuring App Store Connect promotional offers for detailed instructions.

Learn more about configuring the Customer Center in the configuration guide.