Custom Purchase Flows and Paywalls with RevenueCat on Android

Two decisions, not oneReading an offering into your own UI Why there is no eligibility check on AndroidMaking the purchase with PurchaseParams.Builder The callback interface CoroutinesReading the result Entitlements RestoreSwitching plans: Product changes and replacement modes Getting oldProductId right The five replacement modes Choosing a mode DEFERRED reports back differentlyOther PurchaseParams options isPersonalizedPrice Add-onsKeeping RevenueCat's paywall UI PaywallListener: Observing the flow Gating the flow before it starts Getting a result from a full screen paywall Custom variablesOwning the transaction with PaywallPurchaseLogicChoosing an approachConclusion

RevenueCat's prebuilt Paywall composable handles the common case in one line, and for most apps that is where the story ends. But two questions come up over and over: how to run your own code when a purchase succeeds or fails, and how to control what Google Play does when a subscriber switches plans. Both answers live in builders, and both are easy to get wrong because the defaults are silent. A subscription upgrade that charges the wrong amount looks exactly like one that charges the right amount until a user complains.