Skip to main content
Coming soon. The claim handle ships in the next release of each SDK, with the trigger components. See Trigger components.
Gifts Button and Claim Reminder are the recommended way in: one line each, and Encore can change and test their looks without an app update. When your design needs the entry drawn in your app’s own style, draw it yourself instead of skipping the entry. Encore still does everything behind it: it decides when the entry should show and what it shows, counts each view and tap, opens the reward sheet, and hands you the result. After a claim, your entry can turn into a reminder for that claim (it does by default), as Gifts Button does. Everything on Trigger components about the reward sheet, claims, and analytics applies. What differs: you draw it, so Encore’s looks, heights, copy, and colors don’t apply.

How it works

You create one claim handle per placement and read its state. The state says what to draw: You attach your view to the handle. Encore then counts a view when at least half of it is on screen for one second with no sheet over it. On iOS, Android, React Native and the web, a tap on the attached view opens the reward sheet for that placement; on Flutter, call claim.tap() from your view. A tap while the state is hidden does nothing. The state changes on its own: by default it turns into the reminder after the user claims an offer and back into gifts when the claim is finished, its 24 hours end, or the user dismisses it, and to hidden when the offers run out. Encore can change what follows a claim and a completion (below). Redraw whenever it changes.

Add it

The options are placement (required), useCase, autoOpen, publisherReward, and onResult. Encore decides what comes next. As with Gifts Button, Encore sets what your entry shows after a claim and after a completion, and can test it, without an app update. After a claim the state can turn into reminder or stay gifts; after a completed claim it can be gifts, hidden, or thanks. Draw every state and your entry follows. When Encore’s rules can’t be read, a claim turns the state into reminder and a completion turns it back into gifts, as by default, so a failed rules request never hides your entry. If the offers themselves can’t be read, the state is hidden, as for the drop-in trigger components. Opening by itself. Encore may open the reward sheet by itself when a test calls for it: at most once a day per placement, only after your view was really on screen, only while your app is in the foreground, and never over another Encore sheet. Set autoOpen to off to never: autoOpen: .off on iOS, AutoOpen.OFF on Android, AutoOpen.off on React Native, EncoreAutoOpen.off on Flutter, and 'off' on the web. On Android, claim.state is a Compose state, so a Compose view that reads it redraws on every change; outside Compose, collect claim.stateFlow. For Views or code outside Compose, make the handle with Encore.claim(placement = "streak"), attach a view with claim.bind(view), and call claim.close() when you no longer need it. rememberEncoreClaim closes its handle when it leaves the composition. The reminder state also carries perk, the offer’s perk as the sheet showed it.

A view with its own buttons

When your view has buttons of its own, such as a close button on your reminder, don’t let the whole view open the sheet. Report what’s visible and call the tap yourself:
  • iOS and Android: pass handlesTap: false to the modifier (on an Android View, claim.bind(view, handlesTap = false)), and call claim.tap() from your own button. On iOS, tap() returns the sheet’s result; on Android, pass onDone to get it, as in claim.tap(onDone = { result -> }).
  • React Native: pass handlesTap={false} to EncoreClaimView, and call tap() from useEncoreClaim in your own button.
  • Flutter: EncoreClaim never opens the sheet from a tap by itself; call claim.tap() from your own buttons, with target: EncoreClaimTarget.card for a reminder card. It returns the sheet’s result.
  • Web: bind(element, { tap: false }) counts the whole element’s visibility and leaves taps to you; call claim.tap() from your button. In React, pass tap: false to useEncoreClaim and put ref on the element. Even with taps on, a click that starts on a control inside the bound element, such as your close button, never opens the sheet.
claim.dismiss() hides the reminder, every claim it was showing, on this device. Call it from your close button. It does nothing while the state isn’t reminder.

Accessibility

You own the labels. On the web, bind(element) makes an element that isn’t already a button or link behave like one: it adds role="button", lets it take keyboard focus, and opens the sheet on Enter and Space. On iOS and Android the modifier adds the button trait when it handles the tap.

Experiments and analytics

Encore can test what your entry does after a claim and after a completion, as it tests the drop-in trigger components. The reward sheet it opens takes part in its own experiments too: when the sheet’s experiment holds a user out, the state is hidden. Encore reports your entry’s views, taps, and dismissals as it does for its own trigger components, marked as your own button. You don’t send any events.
Don’t also mount a Gifts Button or Claim Reminder at the same placement and screen as your own entry: the user would see two entries for one sheet.