Skip to main content

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 call show() 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

Choosing your integration shape: This page shows the handler pattern. If your call site has direct access to purchase logic, the async-result pattern is often cleaner. See Integration Patterns for the decision tree and React Native Integration Patterns for TypeScript examples.
Register handlers that tell the SDK how to complete purchases and what to do when a user dismisses. Register these once at app startup, after configure() and registerCallbacks().

Register onPurchaseRequest

Called when a user accepts an offer. Use this to trigger a purchase via your billing library.
You must call completePurchaseRequest() in every code path — both success and failure. Failing to do so will block the SDK from presenting future offers.
See onPurchaseRequest() for RevenueCat, react-native-iap, and custom examples.

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

Register onPurchaseRequest and onPassthrough before presenting any placements.

Full Example


Next Steps