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 SDK uses a callback pattern — you register purchase and passthrough handlers, then callshow() wherever you need an offer.
Present Offers
Presenting an Encore offer is a single line:
Important: When presenting offers in critical flows (like cancellation), your onPassthrough handler ensures users are never blocked from completing their intended action.
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 at app startup, afterconfigure() and registerCallbacks().
Register onPurchaseRequest
Called when a user accepts an offer. Use this to trigger a purchase via your billing library.
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)
Fires after a native purchase completes (when no onPurchaseRequest handler is set on the native side). Use this to sync purchase state with your subscription manager.
Summary
| Callback | When it fires | Required? |
|---|---|---|
onPurchaseRequest | User accepts the offer | Yes |
onPassthrough | User dismisses or no offers available | Yes |
onPurchaseComplete | Purchase finishes natively | Optional |
Register
onPurchaseRequest and onPassthrough before presenting any placements.Full Example
Next Steps
- SDK Reference - Complete API documentation