Requires SDK 2.8.0+. This page covers the iOS, Android and web SDKs. On iOS, presented looks need iOS 17 or later, as every trigger look does.
present() on a claim handle asks Encore to show its look for that placement over your screen instead. Encore draws it as a popup, a half sheet or a full-screen cover. A tap opens the reward sheet exactly as a tap on your own view does.
Your own view, the handle’s state and tap() don’t change. present() is one more way to use the same handle.
When to use it
- Use
present()at a moment with no slot, right after something worth rewarding happened. - Use Gifts Button or Claim Reminder where your screen has a slot. Those components already show presented looks by themselves when Encore serves one, so there’s nothing to call.
- Use your own button when you want to draw the entry in your own style.
The three presentation modes
Encore picks the mode per look on its side, so modes are tested like any other look. Your app has no setting for it.
Every container has a close button and a small “Gifts from our partners” label, translated with the rest of the SDK’s text, and keeps screen reader focus inside while it’s up. To close it, the user taps the close button. They can also swipe the half sheet down, press back on Android, or press Escape on the web. On iOS and the web, the container also follows the system’s reduced motion setting.
Call it
present() returns once the look is on screen, or once it’s clear nothing can show. It never throws or rejects.
- iOS:
present()isasyncon the main actor and returns aPresentOutcome:.shown(PresentedMode)or.suppressed(PresentSuppressedReason). AswitchoverPresentSuppressedReasonneeds an@unknown default, since a later SDK may add a reason. - Android:
present()is asuspendfunction that returnsPresentOutcome.Shown(mode)orPresentOutcome.Suppressed(reason). From Views or Java,claim.present { outcome -> }calls back once on the main thread. AwhenoverPresentSuppressedReasonneeds anelsebranch, since a later SDK may add a reason.reason.wireis the shared name every SDK uses, which suits logs and bridges. - Web:
present()resolves{ shown: PresentedMode }or{ suppressed: PresentSuppressedReason }. In React,useEncoreClaim()returns the samepresent(), which resolves{ suppressed: 'unavailable' }before the handle exists.
reminder. A tap opens the reward sheet with the handle’s publisherReward, sheet text and moment. Then onResult gets its result.
Results
present() comes back with one of two outcomes:
A suppressed outcome is normal. Looks are limited per device, so expect a limit’s reason often, and carry on with your screen as if you never called it.
Suppressed reasons
The reasons have the same names on every platform. iOS and the web use them as written; Android’s enum constants are the same names in upper snake case, andreason.wire gives the shared name.
Not shown: nothing to show
The causes of
unavailable per platform:
- iOS: no offers for this user, no answer from Encore, the look went away while it waited, the user changed or no screen to show it on.
- Android: the SDK isn’t configured, no user yet, a network or server error, no offers for this user or the look went away during its delay.
- Web: no offers for this user, a failed request, storage that can’t keep the device limits or a handle that was destroyed. A new user or a language change while it waits also answers
unavailable.
Not shown: a device limit held it
Delay and timing
present()asks Encore for a presented look for the placement, on its own request.- If the look has a delay, the SDK waits it out before showing anything. Encore sets the delay per look, from 0 to 3 seconds.
- Then every device limit is checked, live.
present()has no slot to wait in, so when your app is in the background or another sheet is up, it returnsbackgroundorsheetUpright away instead of waiting for them to clear. - If no limit holds, the container shows and
present()returnsshown.
present() returns unavailable.
Device limits
The same limits apply topresent() and to Gifts Button and Claim Reminder when they show a presented look. By default:
- At most one presented look per app session (per page session on the web).
- At most two presented looks per local day, across placements.
- At most one per placement per local day.
- None in the first 30 seconds of the first session on the device.
- After the user closes a presented look twice in a row at a placement, none at that placement for 3 days. A tap resets the count.
- Never while your app is in the background or the tab is hidden, and never over another Encore sheet.
The first-session quiet period, the background and the other-sheet rules never change. When several limits hold,
present() reports the first one, in the order of the device limit reasons.
A second call while one is up
present() shows one look at a time per handle. A second call while a present() is still waiting or its look is on screen returns sheetUp and shows nothing. Call it again after the first one is closed.
Turning the SDK off
When the SDK is turned off (Encore.shared.isEnabled = false on iOS and Android, Encore.isEnabled = false on the web), present() returns disabled right away, with no request and nothing on screen.
Turning it off while a look is up closes it, and that close doesn’t count as a dismissal. Turning it off while a present() is still waiting answers that call with disabled.
On iOS and the web, identify(), reset() or a language change also take down a presented look this handle shows, since it belonged to the previous user.
Analytics
Encore reports the presented look’s view, tap and close as it does for its trigger components, each with the mode it was shown in. When a device limit other thanbackground or sheetUp holds a look back, Encore records that too, once per placement and reason per day. noLook sends nothing. You don’t send any events.
Related
- Build your own button: the claim handle
present()belongs to. - Gifts Button: Encore’s own gifts entry, which shows presented looks in its slot by itself.
- Trigger components: what every trigger component shares.