Purpose
Create and present Encore offers using a fluent builder API. Fetches available offers for the current user and presents them in a native offer sheet.show() returns the complete PresentationResult record and never throws.
Signature
Methods
show() never throws: every failure is a value on the result, including calling before configure() (NotPresented(NotConfigured)). The suspending forms are safe to call from any thread or scope; the body runs on a background dispatcher and UI work is hopped to Main internally.Use cases
A use case selects which template the backend resolves and which funnel the presentation is counted in. It is a different axis from the placement ID: one use case holds many placements.
Each case carries a fixed wire value (
"churn-intervention" and "post-action-reward") that the backend stores and that analytics splits the funnel on. The constant names are the API surface; the wire values are the contract.
Usage
Suspend (recommended)
Callback form
Reward surface
With named placements for analytics
Appearance
The sheet renders in light, dark, or automatic appearance, following the appearance mode configured for your app in the Encore dashboard. Automatic is the default: the sheet follows your host app’s theme, falling back to the device setting when that theme can’t be read. The sheet runs in its own Activity, so this is what keeps it visually part of the app it presents over rather than following the device past a host that pins its own style.Claim CTA toggle
Encore.shared.isClaimEnabled controls whether the claim CTA on offer cards is tappable. It is runtime-mutable by design: flip it to false to gray out and disable the claim button, and back to true to re-enable it.
Related
- PresentationResult: the returned record and its fact readers
- Encore.outcomes: every resolution also lands on the passive stream
- Integration Patterns: choosing between the suspend and callback forms