Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
handler | (Transaction, String) async -> Void | Closure receiving the verified StoreKit Transaction and productId |
When It Fires
onPurchaseComplete fires only when:
- No
onPurchaseRequesthandler is registered - Encore successfully completes a native StoreKit 2 purchase
- The transaction is verified and finished
- An
onPurchaseRequesthandler is set (the delegated handler takes full responsibility) - The user cancels the purchase
- The purchase fails or is pending
Usage
Use this callback to sync StoreKit transactions with subscription managers that don’t automatically detect external purchases.Adapty
Qonversion
RevenueCat and Superwall auto-detect StoreKit 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
- Main actor — called on the main thread