Skip to main content
Presents the offer sheet and resolves when the sheet closes after a claim or a dismissal, or at once when no offers are eligible. A 'rewardUsers' claim opens the advertiser at once; a 'reduceChurn' claim is saved for redeem(). See The Claim Flow.

When to use this

Call show() at the moment you want to present an offer: a cancel flow, a paywall, an onboarding step, a celebration screen. Most integrations present via the fluent placement(id).show() builder, which resolves the same ShowResult; Encore.show() is the inline one-call variant, and the only form that accepts an onError callback.

Signature

placementOptions and placementId mirror the fluent placement(id, options).show() form. The builder’s own show() takes no arguments at all: onNotGranted is set once via placement(id).onNotGranted(), and the builder has no onError equivalent. Use the inline form shown here if you need that callback.

Parameters

ShowResult

reason (a NotGrantedReason) is one of 'userClosedModal', 'userClickedOutside', 'userDeclinedLastOffer', 'noOffersAvailable', 'notConfigured', 'alreadyPresenting', or { type: 'error', error }. Two of those describe a sheet that never appeared rather than one the user dismissed: Both names match the native SDKs’ vocabulary for the same conditions.

The claimed payload

The payload mirrors the iOS and Android ClaimedOffer field for field, so a cross-platform integration reads one shape everywhere.
transactionId is optional by design. The transaction write can fail while the claim itself genuinely happened. The SDK logs a warning naming the attribution consequence rather than fabricating a placeholder, and the result still resolves claimed: a failed write must not retroactively turn a real claim into a decline.
show() never rejects. There is no crash path and no try/catch needed: a failure resolves as { status: 'dismissed', reason: { type: 'error', error } }, and calling show() before configure() resolves as { status: 'dismissed', reason: 'notConfigured' }.
The result does not report a conversion. claimed means the user accepted an offer; the advertiser completion happens later, asynchronously, via server-side postbacks. Verify completions and entitlements server-side, by user, with Encore’s server-side entitlements API, never from the client, and never from this result.

Examples

Present and branch

With a use case and copy

Gotchas

  • unavailable is overloaded. It means “no eligible offers”, “measurement control cohort (ghost trigger)”, or “nothing to present for the requested useCase”; the SDK keeps them indistinguishable on purpose so incrementality experiments aren’t contaminated. Don’t branch app behavior on a suspected control assignment; just show your normal fallback.
  • An unrecognized useCase fails loudly, not silently. A typo or an unsupported value (not 'reduceChurn' or 'rewardUsers') resolves dismissed with an INVALID_REQUEST error, firing both onError and onNotGranted immediately, before any presentation attempt. That’s an integration bug, not a normal outcome: don’t confuse it with the silent unavailable a valid useCase with nothing to present produces. The values Encore sends over the wire are not accepted here; passing one is exactly this error. See Errors.
  • onError doesn’t catch every error result. It fires when the flow never started or threw, not when the flow returns an error. Branch on reason.type === 'error' if you want to catch both classes.
  • Your confirmation is yours to render. See The Claim Flow.
  • show() doesn’t need a click handler. The advertiser tab opens inside a tap on a button in the SDK’s own sheet.
  • Claim is not a conversion. Never grant access off a claimed result; verify entitlements server-side, by user (see the preceding warning).
  • The Claim Flow: what a claim does, and what its payload carries.
  • placement: present at a named placement, and the full options contract.
  • Errors: the error-as-value contract.
  • redeem(): hand off a saved Reduce Churn claim.
  • Updating to 2.x: moving a 1.x integration onto 2.x.