When to use this
Callshow() at the moment you want to present an offer: a cancel flow, a paywall, an
onboarding step, a celebration screen. There is no second call to make afterward.
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' }.Examples
Present and branch
With a use case and copy
Gotchas
unavailableis overloaded. It means “no eligible offers”, “measurement control cohort (ghost trigger)”, or “nothing to present for the requesteduseCase”; 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
useCasefails loudly, not silently. A typo or an unsupported value (not'reduceChurn'or'rewardUsers') resolvesdismissedwith anINVALID_REQUESTerror, firing bothonErrorandonNotGrantedimmediately, before any presentation attempt. That’s an integration bug, not a normal outcome: don’t confuse it with the silentunavailablea validuseCasewith nothing to present produces. The values Encore sends over the wire are not accepted here; passing one is exactly this error. See Errors. onErrordoesn’t catch every error result. It fires when the flow never started or threw, not when the flow returns an error. Branch onreason.type === 'error'if you want to catch both classes.- Nothing renders after a claim. There is no built-in success screen; if that flow needs
a confirmation moment, render it yourself when the result is
claimed. show()doesn’t need a click handler. The advertiser tab opens inside the user’s tap on Claim, within the SDK’s own sheet, so popup blockers have nothing to catch.- Claim is not a conversion. Never grant access off a
claimedresult; verify entitlements server-side, by user (see the preceding warning).
Related
- 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.
- Updating to 2.x: moving off the two-phase flow.