onPurchaseRequest succeeded or failed. This must be called in every code path of your onPurchaseRequest handler.
Signature
Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | true if the purchase succeeded, false if it failed or was cancelled |
Usage
Standard pattern
Common mistake — missing failure path
Behavior
- One active request: Only one purchase request is active at a time. Calling
completePurchaseRequest()resolves the current request. - Idempotent: Calling it when no request is pending returns
{ success: false }with an error message — it does not throw. - Stale cleanup: If a new
onPurchaseRequestfires before the previous was completed, the stale request is automatically failed.
On iOS, failing to complete the request keeps the offer sheet coordinator active, preventing future
show() calls from presenting. On Android, the purchase coroutine remains suspended indefinitely.