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 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

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 Flutter Integration Patterns for Dart examples.
Register handlers that tell the SDK how to complete purchases and what to do when a user dismisses. Register these once after configure().

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.).
If you do not set onPurchaseRequest, the native SDK handles the purchase itself using StoreKit (iOS) or Play Billing (Android) and presents the native subscription modal automatically. This is useful for apps that don’t use a third-party subscription manager.

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

onPassthrough should be registered before presenting any placements so users are never blocked from completing their intended action.

Using the Result

placement().show() returns an EncorePresentationResult that you can use for flow control:

Full Example


Next Steps