Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
handler | suspend (BillingPurchaseResult, String) -> Unit | Suspend function receiving the BillingPurchaseResult and productId |
BillingPurchaseResult
When It Fires
onPurchaseComplete fires only when:
- No
onPurchaseRequesthandler is registered - Encore successfully completes a native Play Billing purchase
- The purchase is acknowledged
- An
onPurchaseRequesthandler is set - The user cancels the purchase
- The purchase fails
Usage
Adapty
Qonversion
RevenueCat and Superwall auto-detect Play Billing transactions when configured in observer mode. They do not need
onPurchaseComplete.Chaining
Behavior
- Survives
reset()— app-level infrastructure, not user state - Last handler wins — setting a new handler replaces the previous one