Use this page with AI
Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/apis/android/acknowledge-purchase-android and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.
My request: [describe what customers should be able to do]Android acknowledgePurchaseAndroid
Acknowledge a non-consumable purchase or subscription. Required within 3 days or the purchase will be refunded.
Wraps BillingClient.acknowledgePurchase(AcknowledgePurchaseParams) — required for non-consumables and subscriptions within 3 days, otherwise Google auto-refunds. See the Google Play Billing reference.
Signature
// OpenIapModule (OpenIapProtocol); OpenIapStore does not expose it
val acknowledgePurchaseAndroid: suspend (purchaseToken: String) -> BooleanParameters#
purchaseToken(required,string) — Purchase token from the Play Billing transaction.
Returns#
Promise<boolean> — true once the purchase has been acknowledged. When the store refuses the token, React Native, Expo, and KMP reject with the store's error code; Kotlin, Flutter, Godot, and MAUI return false. In Kotlin, finishPurchaseToken(token, isConsumable = false) throws instead.
Example
// Share one module with OpenIapStore(module) instead of creating a second client.
val module = OpenIapModule(context)
val token = requireNotNull(purchase.purchaseToken)
module.acknowledgePurchaseAndroid(token)Note: Called automatically by finishTransaction() when isConsumable is false.
See: finishTransaction