Android openRedeemOfferCodeAndroid
Open the Google Play offer/promo code redemption flow so the user can enter a code.
Available in OpenIAP Spec 2.4.2 / openiap-google 2.5.0. Launches the Play Store redeem page (https://play.google.com/redeem) as a deep link, so it does not require the billing client to be initialized and has no Play Billing version requirement. See Google Play promotions for the code types Play supports.
The user leaves your app for the Play Store. If the app remains running with an active billing connection, the redeemed purchase can arrive through the standard purchase listeners. Register purchaseUpdatedListener before launching, and reconcile with getAvailablePurchases when the app resumes — the complete reconciliation sequence is in the Offer Code Redemption guide.
Signature
// Returns true when the redemption flow was launched
// No billing client required — opens the Play redeem page
suspend fun openRedeemOfferCode(activity: Activity): BooleanReturns#
Promise<boolean> — true when the redemption flow was launched. Store flavors without an equivalent flow return false. The redeemed purchase itself is not returned; use the listener and resume reconciliation paths described above.
Example
openIapStore.openRedeemOfferCode(activity)