Signature
PlacementOptions
One flat shape. No option picks the sheet: it follows fromuseCase and what Encore serves for it (Sheet Variants).
Field Reference
headline and subheadline here set the copy. appearance.headline and
appearance.subheadline set how that copy looks, or replace the element entirely.
They are different fields with the same names, and they compose: a non-blank
appearance.headline.text beats this one on the built-in reward sheet, and everything
else about the slot is styling. See Advanced UI.The
useCase symbols match the native SDKs verbatim (iOS .reduceChurn / .rewardUsers,
Android REDUCE_CHURN / REWARD_USERS), so a cross-platform integration reads one
vocabulary. The values Encore sends and stores are separate frozen labels, which is what
keeps a rename from ever changing the wire. You never type a wire value here: passing one is
rejected as an unrecognized use case.useCase: 'rewardUsers').
PlacementBuilder
moment()
currency, the SDK uses the browser language’s currency only when that language names a region, such as es-MX. A bare language such as es sends no currency.
On a development origin with logLevel: 'debug', a placement shown with no moment logs one warning per placement. How to choose a moment type: Tell Encore the Moment.
location() and trigger()
embedded when your launcher sits inside a screen, popup or sheet that shows other content (a button in a celebration popup), and standalone when the launcher is the whole UI that appears (a toast, a drop-down notice, a floating badge). Trigger components report their own trigger values. See Describe your placement in code.
useCase(useCase)
Sets which use case this placement serves. Equivalent to passinguseCase in the options
object, and composes with the other builder methods:
'reduceChurn' if never called. See
Reward Users for the full guide.
A value other than 'reduceChurn' or 'rewardUsers' is an integration bug, not a normal
decline: show() resolves dismissed with an INVALID_REQUEST error, and
onNotGranted carries it. The builder has no onError equivalent,
so use Encore.show()’s inline form if you need that
callback too. See Errors.
headline(text) and subheadline(text)
Override the sheet’s copy for this presentation. Identical in effect to passingheadline / subheadline in the options object, so pick whichever reads better at the
call site:
placement() itself.
Both steps match the native SDKs’ .headline(...) / .subheadline(...), so a
cross-platform integration reads the same at every call site.
onNotGranted(callback)
Fires when the sheet closes without a claim, carrying the dismissal reason (the sameNotGrantedReason a dismissed result carries).
onLoadingStateChange(callback)
Firestrue when the presentation starts loading and false when it settles; useful for
spinners and disabling the triggering button. Callbacks are scoped to this builder instance;
they don’t persist across calls.
show()
Presents the sheet with this placement’s options and resolves theShowResult
('claimed' | 'dismissed' | 'unavailable'). It takes no arguments: everything a
placement can be configured with lives in PlacementOptions, passed to
placement() or set through the builder steps above. Never rejects.
redeem()
Shows the redemption screen, whose button opens the advertiser, for the claim saved at this placement id; with no id, for the most recent claim. Same contract asEncore.redeem().
Examples
Reward users at a moment your app detected
For celebrating a moment your app already detected (a completed purchase, a streak, a milestone): the Reward Users use case. Its built-in sheet renders its own chrome, andheadline / subheadline are the top
of its copy chain:
Reduce churn at a named placement
show() ·
redeem().
SheetAppearance
AppearanceConfig.sheet styles a served reward sheet per component, and a value set in the Style editor (when it is on for your app) wins over app code per property. Fonts come from app code only. How to use it: Sheet Appearance.
Structure
Field reference
SheetAppearance
SheetComponentStyle: every field is optional. The element the variant draws decides which fields apply; a field that does not apply, or a value out of range, is dropped with a warning in the SDK log.
animation
enter and loop: both are skipped or held still when the device asks for reduced motion.
Related
show(): theShowResultcontract and the inline form.redeem(): hand off a saved Reduce Churn claim.- The Claim Flow: what a claim does, and what its payload carries.
- Reward Users: the
useCase: 'rewardUsers'use case. - Updating to 2.x: moving off the nested
headeroptions.