Signature
Parameters
| Name | Type | Description |
|---|---|---|
handler | suspend (String, String) -> Unit | Suspending callback receiving (productId, placementId). Trigger your purchase flow here. |
Returns
Returns theEncore instance for chaining.
Usage
With RevenueCat
Chained with onPassthrough
The handler is a
suspend function, so you can call other suspending APIs (like network requests or billing APIs) directly inside it.When no
onPurchaseRequest handler is set, Encore handles purchases via native Play Billing automatically.
Use onPurchaseComplete to sync these transactions with providers that don’t auto-detect Play Billing transactions (e.g., Adapty, Qonversion).