Overview
Encore allows you to present targeted offers to users in exchange for rewards (free trials, discounts, credits) at critical moments like cancellation flows or feature paywalls. The native SDK renders all offer UI natively (SwiftUI on iOS, Jetpack Compose on Android) — the Flutter layer triggers presentation and receives results.Present Offers
Presenting an Encore offer is a single call:Register handlers before presenting. See Handle Offer Results below.
Handle Offer Results
Register handlers that tell the SDK how to complete purchases and what to do when a user dismisses. Register these once afterconfigure().
Register onPurchaseRequest
Called when a user accepts an offer and a purchase is needed. Use this to trigger a purchase via your Flutter-side subscription manager (RevenueCat, in_app_purchase, etc.).
Register onPassthrough
Called when the user dismisses the offer or no offers are available. Use this to resume the user’s original action (e.g., proceed with cancellation).
onPurchaseComplete (Optional)
Only fires when no onPurchaseRequest handler is set and the native SDK handles the purchase itself. Use this to sync the transaction with subscription managers that don’t auto-detect native purchases.
Summary
| Callback | When it fires | Required? |
|---|---|---|
onPurchaseRequest | User accepts an offer, purchase needed | Recommended |
onPassthrough | User dismisses or no offers available | Yes |
onPurchaseComplete | Native purchase finishes (no onPurchaseRequest set) | Optional |
onPassthrough should be registered before presenting any placements so users are never blocked from completing their intended action.Using the Result
placement().show() returns a PresentationResult that you can use for flow control:
Full Example
Next Steps
- Add Subscription Product — Create a subscription product and connect it to Encore