Part 4 of 4: the last two phases of the KMP contest starter kit. Subscriptions, credits and ads, then analytics, feature flags and notifications.New here? Part 1 introduces the kit and gets your app running on your machine. Part 2 connects it to Firebase, sign in and a backend. Part 3 publishes it to the stores.Your app is in the stores and people are installing it. Two questions are left: should it make money, and how do you keep people using it? These are the kit’s last two phases, monetization and growth, and this post covers both.Free or paidBy default the kit has no paid features. In AppConfiguration.kt:PREMIUM_FEATURES_ENABLED = falseWith false there is no paywall, no upgrade buttons, billing is never initialized, and credits are off, so everything in the app is free. If your app should stay free, leave it and go to the growth part below.To add paid features, set it to true. The paywall, the subscriptions screen and the credit system all turn on.Decide the offer firstBefore opening any billing dashboard, decide what you sell. The kit keeps this in one file: AiGuidelines/project/paywall.md. What is premium was already decided in phase 1. What's left is marked TODO(monetization): prices, trial length, credit pack sizes.Ask your assistant to “design the paywall” and it asks you about each one:Agent: Your paywall has a weekly and a yearly plan. What should the yearly price be? Weekly at $4.99 adds up to about $260 a year, so a yearly price under $60 shows as a big saving. And how long should the free trial be, 3 days or 7?The kit’s paywall guide has three rules:Write the terms clearly: “7 days free, then $39.99 a year. Cancel anytime.”No fake countdowns and no hidden cancel button.Show the paywall at the end of onboarding, not on first open.The paywall text lives in strings.xml, with a paywall_ prefix on every string, so you change the copy without touching code. To see the result, ask "show me the paywall" and the kit renders it to an image:Demo modeYou can test the whole payment flow before creating any billing account. When no subscription keys are set, the kit uses a built in demo provider:The paywall shows demo products.A purchase succeeds without real money, and premium turns on.Buying a credit pack adds credits.You can cancel from the Subscriptions screen, and premium locks again.The paywall shows a warning that it is a demo, so you can’t mistake it for the real thing. It works on every platform. When you add real keys, the kit switches to the real provider automatically.Subscription providerReal billing goes through Adapty or RevenueCat. These services sit between your app and both stores and handle receipts, renewals and refunds. The kit supports both. You choose with one line in gradle.properties:SUBSCRIPTION_PROVIDER=ADAPTYOr REVENUECAT. The rest of the app code stays the same.Create an account with the provider and copy its two SDK keys into local.properties:SUBSCRIPTION_PROVIDER_ANDROID_API_KEY=...SUBSCRIPTION_PROVIDER_IOS_API_KEY=...Then run the check script for this phase:./MobileApp/scripts/check_env.sh --phase monetizationA missing key does not fail the build. The paywall just stays in demo mode. That is fine during development, but not in a release, so run the check before you publish.Store products and a test purchaseCreate the subscription products in both stores, under Subscriptions in App Store Connect and in Play Console. On iOS, also add the In-App Purchase capability in Xcode. Use the prices from your paywall file, and use the same product IDs on both platforms, for example premium_monthly and premium_annual.Link them in the provider dashboard. Connect the store products and map them to an access level called Premium. This is the name the kit checks, defined in Constants.kt.Make a test purchase. Both stores have a test mode where purchases are free: a sandbox tester on Apple, a license tester on Google Play. Buy on a real device and check that the paywall closes and premium is on.By default the kit shows its own paywall screen. Both providers can also show a paywall that you edit on their website, without an app update. To use that, set the SHOW_REMOTE_PAYWALL flag to true.CreditsIf your app calls AI models, every generation costs you money, so a subscription alone may not cover heavy users. The kit has a credit system for this. The rules are in Di.kt:val appCreditSystemConfig = creditSystemConfig { oneTimeBonus("welcome_bonus_credit", 1) recurringWeekly( id = "premium_plan_weekly", amount = 10, condition = { subscriptionRepository.hasPremiumAccess() }, )}This gives every new user 1 free credit and gives subscribers 10 credits every week. There are also recurringDaily and recurringMonthly, and any rule can have a condition.In code, creditRepository.useCredits() spends a credit. When the balance is empty it throws an exception, and the screen opens the credit pack paywall. A balance screen and a credit badge in the toolbar are already built.Credit packs are sold through the same provider. Create them as consumable products in both stores and add them to the credits_pack placement in the provider dashboard.Credits are saved on the device only. For a first app this is enough. If you later need balances that sync between devices, the kit has a guide for moving them to a server.AdsAdMob is built in and turned off by default. To turn it on:Set IS_ADS_ENABLED to true in FeatureFlagManager.Create your app and ad units in the AdMob console and put the IDs in local.properties. The iOS app id goes into BaseConfig.xcconfig.During development, use Google’s test ad unit IDs. Clicking your own real ads is against AdMob policy and can get your account suspended.Place the ads. There are three types: a banner (AdmobBanner()), an interstitial, and a rewarded ad. A rewarded ad can give the user a credit.Update the data safety form on Google Play and the App Privacy section on Apple, because AdMob collects the advertising ID.GrowthThe growth tools all use the Firebase project from part 2, so there are no new accounts and no new keys. You don’t need all of them on day one. Here they are in the order I would turn them on.Crash reportsCrashlytics is already connected. Enable it once in the Firebase console. When the app crashes on a user’s phone, you see the exact line of code that failed.AnalyticsAnalytics tells you which screens and features people really use. In the kit, everything goes through one Analytics interface:analytics.logScreenView("map")analytics.logEvent(Analytics.EVENT_PIANO_ADDED, mapOf("has_photo" to true))Event names are constants in the Analytics file, next to the ones the kit already logs, like screen_view and paywall_dismissed. Add your own there.Start with a few events that follow the user’s path. For the PianoSpot example:onboarding_completedpiano_added, the main action of the apppiano_sharedpaywall_shown and purchase_completedpermission_denied, with the permission nameTo check that events arrive, use Firebase DebugView. Run this once with your phone connected:adb shell setprop debug.firebase.analytics.app com.you.pianospotThen use the app, and the events show up in the Firebase console within seconds.A week after launch, look at three numbers: how many users finish onboarding, which event happens most, and how many paywall views turn into purchases.Feature flagsFeature flags let you change the app’s behavior without publishing an update. The kit’s FeatureFlagManager reads them from Firebase Remote Config. Each flag has a key and a default value in code:object Keys { const val IS_ADS_ENABLED = "is_ads_enabled" const val SHOW_REMOTE_PAYWALL = "show_remote_paywall" const val MAP_CLUSTERING = "map_clustering" // your new flag}val DEFAULT_VALUES = mapOf( Keys.IS_ADS_ENABLED to false, Keys.SHOW_REMOTE_PAYWALL to false, Keys.MAP_CLUSTERING to false,)Read a flag with featureFlagManager.getBoolean(Keys.MAP_CLUSTERING). To change it, add a parameter with the same key in the Firebase console and publish. The app picks up the new value on the next start.What you can do with this:Turn off a broken feature without a new release.Show a new feature to 10% of users first.Test two versions of a screen and compare them with your analytics events.Turn on ads or the remote paywall, which are already flags.NotificationsNotifications bring users back to the app. The kit uses KMPNotifier, an open source library where the same code works on Android and iOS. There are two kinds: local and push.Local notifications are created by the app on the device. No server is needed:KMPNotifier.localNotifier.notify( title = "Piano saved", body = "Your Central Station piano is on the map.",)A local notification can also be scheduled for later:KMPNotifier.localNotifier.notify { id = 1001 title = "Any pianos on your route today?" body = "Open the map to see what's nearby." scheduledAt = Clock.System.now().plus(1.days).toEpochMilliseconds() payload { put("screen", "map") }}Scheduled notifications are a simple way to improve retention, because they need no backend. Three ways to use them:The day after onboarding. Schedule one reminder that mentions the goal the user picked during onboarding.A daily reminder. When the user finishes today’s action, schedule tomorrow’s reminder. Cancel it with remove(id) when they open the app, so they only see it on days they forgot.After a week away. When the app goes to the background, schedule one notification for a week later, and move it forward on every open. It only fires if the user has been away for a week.Push notifications are sent from outside the app, through Firebase Cloud Messaging. The kit already listens for them. Android needs no extra setup. For iOS, create an APNs key in the Apple developer portal, upload the .p8 file in the Firebase console under Cloud Messaging, and add the Push Notifications and Background Modes capabilities in Xcode. Then send a test message from the Firebase console to a real device.You don’t need your own server for push. The Firebase console can send a message to all users or to a group, for example users in one country or users who haven’t opened the app for 14 days.When the user taps a notification, the kit calls onNotificationClicked with the payload. Use it to open the right screen.Two things to keep in mind:Ask for the notification permission after the user understands why they’d want notifications, not on first open. The kit has rememberNotificationPermissionState() for this. iOS shows the system prompt only once, and Android stops showing it after two refusals.Don’t send notifications that have no value for the user. People turn notifications off, or uninstall the app.Reviews and sharingReview prompt. The kit includes the native rating dialog with a 7 day cooldown, so users are not asked too often. Show it after the user completes something successfully. The kit’s example shows it after a purchase.Sharing and referrals. The virality_loops.md file in your product folder is where you plan this: what users can share from the app, and whether there is a referral bonus. For a bonus, the credit system has oneTimeBonus with a condition. You can use it to give credits when a referral completes.Wrapping upThat’s the whole series. The five phases again:Getting started: your app running on your own device, with no accounts.Integrations: Firebase, sign in and a backend, when your app needs them.Publishing: store listings, signing, and releases from GitHub.Monetization: subscriptions, credits and ads, tested in demo mode first.Growth: crash reports, analytics, feature flags and notifications.You don’t have to do all of them. Start with phase 1 and add the next phase when your app needs it.The kit is free and open source: github.com/KotlinFoundation/kmp-contest-starter-kit, with full documentation at https://kotlinfoundation.org/kmp-contest-starter-kit-documentation/. If you have an app idea waiting, part 1 is where to start.Koko, KMP Starter Kit — Part 4: Monetization and Growth was originally published in ProAndroidDev on Medium, where people are continuing the conversation by highlighting and responding to this story.
Koko, KMP Starter Kit — Part 4: Monetization and Growth
Koko, KMP Starter Kit — Part 4: Monetization and Growth
Editor
Nov 19, 2026 · 11 min read

From other categories

Security
Most Wanted: The Phishing Kits and Techniques Getting Past Security Controls
just now·1 min

AI & Machine Learning
Quoting Jack Despain Zhou
36m ago·1 min

Hardware
Scientific Analysis of Nontraditional Garden Watering Method
45m ago·3 min

Operating Systems
Security updates for Thursday
2h ago·2 min

Databases
Cornelia Biacsics: Contributions for week 46
4h ago·2 min
![Episode 76 “Java in the Age of AI” [AtA]](/_next/image?url=https%3A%2F%2Fapi.wrkm.app%2Fstorage%2Fmedia%2Ffeeds%2F2026%2F11%2Fab2f03b6f2b125c45205d40006845b5d7b3825da.jpg&w=3840&q=75)
Programming Languages
Episode 76 “Java in the Age of AI” [AtA]
16h ago·1 min