Store Messages and Offer Codes
Show the store's billing-issue and price-increase messages when your app chooses, and let subscribers redeem offer codes and promo codes.
Both stores can talk to a subscriber inside your app: a payment that failed, a price increase that needs consent, a win-back offer. Both also let a subscriber redeem a code you handed out. The SDK exposes each with one call on every platform.
Store messages
| Type | iOS (StoreKit Message.Reason) | Android (Play in-app messages) |
|---|---|---|
billingIssue | .billingIssue (iOS 16.4+) | TRANSACTIONAL category |
priceIncreaseConsent | .priceIncreaseConsent | TRANSACTIONAL category |
generic | .generic, and any reason newer than the SDK | — |
winBackOffer | .winBackOffer (iOS 18+) | — |
iOS. StoreKit 2 (iOS 16+) delivers App Store messages through Message.messages. With no listener, StoreKit shows each one itself when the app comes to the foreground, which can be in the middle of your onboarding or a checkout. configure decides who shows them:
automaticStoreMessages: true(the default): StoreKit's own behaviour. The SDK does not listen.automaticStoreMessages: false: the SDK listens and holds every message. CallshowStoreMessageswhen a screen can be covered. Held messages are shown oldest first, each once. Without a foreground window scene (the app is in the background, or the call comes from an app extension) nothing is shown and the messages stay held for a later call.
A message the App Store sends before configure runs is shown by StoreKit itself, so call configure at launch.
Android. Google Play shows its in-app messages (a snackbar about a declined payment, a price increase waiting for consent) only when the app asks, through BillingClient.showInAppMessages with the TRANSACTIONAL category. Google recommends asking every time the app opens. showStoreMessages (Kotlin: showInAppMessages) asks over the current Activity. When the subscriber fixes the payment or accepts the increase, Play answers SUBSCRIPTION_STATUS_UPDATED with the purchase token; the SDK posts that purchase to the server again and refreshes entitlements, so the change arrives on the change stream. automaticStoreMessages does nothing on Android.
Rovenue.configure({ apiKey, automaticStoreMessages: false });
// After onboarding:
await Rovenue.showStoreMessages(); // every type
await Rovenue.showStoreMessages(['billingIssue']); // only thesetry Rovenue.configure(apiKey: apiKey, automaticStoreMessages: false)
// After onboarding:
await Rovenue.shared.showStoreMessages() // .all
await Rovenue.shared.showStoreMessages(for: [.billingIssue])// In an Activity, e.g. onResume:
Rovenue.shared.showInAppMessages(this) // StoreMessageType.ALL
Rovenue.shared.showInAppMessages(this, setOf(StoreMessageType.BILLING_ISSUE))await Rovenue.instance.configure(apiKey: apiKey, automaticStoreMessages: false);
await Rovenue.instance.showStoreMessages();
await Rovenue.instance.showStoreMessages({StoreMessageType.billingIssue});What can go wrong:
- A second call while a message is up does not show it again (iOS: a shown message leaves the queue first; Android: a call while Play's overlay is up returns without asking again).
- Kotlin: a finishing or destroyed Activity throws
InvalidArgument; Play's own failure (billing unavailable, for one) is thrown as the mapped store error. A failed entitlement refresh afterSUBSCRIPTION_STATUS_UPDATEDis logged, not thrown. - Asking only for
generic/winBackOfferon Android does nothing: Play has no category for them. - Web: there are no store messages. The web SDK has no such call.
What the server records about a price increase, and the events it sends while the subscriber decides, is in Price changes.
Offer codes and promo codes
iOS. presentCodeRedemptionSheet() presents the App Store's offer-code sheet (AppStore.presentOfferCodeRedeemSheet(in:), iOS 16+) over the foreground window scene. Apple reports nothing about the code. A redeemed code becomes a transaction that arrives through Transaction.updates, which the SDK already listens to: it is posted to the server like any purchase made outside the app, recorded with offerType 3 (offer code), offerKind offer_code and the offer's reference name, and the new access arrives on the change stream. The call returns when the sheet closes; closing it is not an error. A second call while the sheet is up returns at once without a second sheet. It throws StoreProblem without a foreground window scene, and StoreServiceUnavailable (retryable) when StoreKit could not reach the App Store.
Android. redeemPromoCode(activity, code?) opens Google Play's redeem page, https://play.google.com/redeem?code=…, with the code filled in when you pass one. Play redeems it outside your app; the purchase it creates is picked up by the SDK's foreground reconcile when the subscriber returns (or on the next launch), posted, and announced like any purchase; the purchase records offerKind promo_code (and the code itself as offerIdentifier for a vanity code with no offer). It throws StoreProblem when no app can open the page.
React Native and Flutter have both calls. presentCodeRedemptionSheet() opens Play's redeem page on Android; redeemPromoCode(code) presents the offer-code sheet on iOS, which cannot be pre-filled, so the code is used on Android only.
await Rovenue.presentCodeRedemptionSheet();
await Rovenue.redeemPromoCode('SPRING25'); // Android fills it intry await Rovenue.shared.presentCodeRedemptionSheet()Rovenue.shared.redeemPromoCode(activity, "SPRING25")await Rovenue.instance.presentCodeRedemptionSheet();
await Rovenue.instance.redeemPromoCode('SPRING25');The offer-code sheet may not appear in the simulator, or on a device whose App Store account has not accepted the current terms. Offer codes are redeemable in the sandbox and in TestFlight. Apple's legacy in-app purchase promo codes are not offer codes and do not work with this sheet.
From a funnel
A native funnel's button can run the redeem_offer_code action. The SDK opens the same sheet (iOS) or redeem page (Android) itself; there is no handler to implement. Nothing waits on it, so the chain moves on at once and the action is refused on a page that advances on a timer. It is native-only: a web funnel cannot carry it. An SDK older than the action skips it. See Purchases and effects.
On the web
Web checkout through the web SDK (/v1/checkout) can show Stripe Checkout's own promotion-code field: pass allowPromotionCodes: true to checkout(). The codes are your connected Stripe account's promotion codes. See Payment methods.
Non-renewing Subscriptions
Sell a pass for a fixed period — a 30-day pass, a season pass — on the App Store, Google Play or the web, and let Rovenue end it on time.
Price Changes
What Rovenue records when the App Store or Google Play raises a subscription's price, the store messages that ask for consent, and the events your systems receive.