Signature
placement() is static: call it as Encore.placement('cancel_flow').
Each option returns a new builder, so a builder can be reused or shared without one call site changing the configuration of any other.
Parameters
show()
show() fetches offers, presents the native offer sheet, and completes when the presentation record is sealed. It never throws on iOS or Android: every failure, including “nothing was presented”, is a value on the returned EncorePresentationResult.
Use cases
useCase() selects which Encore surface the placement presents. It defaults to EncoreUseCase.reduceChurn.
The case names describe the capability;
nativeValue is the label the backend stores.
A use case with no enabled variant resolves
EncoreNotPresented with EncoreNotPresentedReason.useCaseUnavailable rather than falling back to the churn-intervention sheet.Copy overrides
headline() and subheadline() override the sheet’s copy for one presentation, on every use case. The native side writes the value into the variable the active template reads.
Priority order, first one set wins: this value, then the copy Encore resolved for your app, then the shipped template default. A blank string is ignored.
Encore never translates a string you pass, so localization, pluralization, wording, and emoji stay yours. The Encore-resolved copy beneath it is translated into the user’s language; see Localization.
Reward for trying
From 2.3.0,publisherReward() takes an EncorePublisherReward(id:, title:, detail:, iconUrl:), where detail and iconUrl are optional, and describes a prize your app pays for trying an offer. When the user says they finished and Encore’s server grants the prize, result.claim?.userConfirmedCompletion is true on the result show() returns, and your app grants the prize from that result only. De-duplicate on your own user ID plus campaignId, because transactionId can be null. Setup, the daily limit, and when the flag stays false: Reward for Trying.
Platform notes
- iOS presents only on iOS 17 or later. On older versions
show()resolvesEncoreNotPresentedwithEncoreNotPresentedReason.unsupportedOS, even though the plugin installs on iOS 15. - Android attaches the sheet to the Activity the plugin is bound to. With no foreground Activity,
show()resolvesEncoreNotPresentedReason.noForegroundActivity.
Related
- EncorePresentationResult: what
show()resolves to - EncorePurchaseController: the purchase path a presented offer runs through
- Reward Users and Reduce Churn for what each surface is for