> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DismissReason

> How a presented offer sheet went away

The `dismissal` axis of a presented flow's [`Outcome`](./presentation-result): how the sheet actually ended. These are business outcomes, not errors. Genuine failures arrive as values in `NotPresented(NotPresentedReason.Error(...))`, never here.

`value` is the analytics wire value: the same string lands in `decline_reason` on `sdk_offer_sheet_dismissed`, unmapped.

## Definition

```kotlin theme={null}
enum class DismissReason(val value: String) {
    UserTappedClose("close_button"),
    UserSwipedDown("swipe_dismiss"),
    Cooldown("provisional_cooldown"),
    FlowCompleted("flow_completed"),
    Interrupted("interrupted"),

    // Emission-only analytics values; Outcome.dismissal never carries these.
    OfferClaimed("offer_claimed"),
    AppBackgrounded("app_backgrounded"),
    AppTerminated("app_terminated"),
}
```

## Cases

| Case              | Wire value             | Description                                                                                                                                                                  |
| ----------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `UserTappedClose` | `close_button`         | The user tapped the close button or used the back gesture; on the native fallback sheet a tap outside the sheet also reports this                                            |
| `UserSwipedDown`  | `swipe_dismiss`        | The user dismissed by gesture. On the server-driven sheet (the default) this covers dragging down and tapping outside; on the native fallback sheet only dragging reports it |
| `Cooldown`        | `provisional_cooldown` | Claim rejected server-side (HTTP 409, cross-offer provisional cooldown)                                                                                                      |
| `FlowCompleted`   | `flow_completed`       | The flow finished on its own and the SDK closed the sheet                                                                                                                    |
| `Interrupted`     | `interrupted`          | The SDK force-ended a dead flow (structural reconciliation), not the user                                                                                                    |

`dismissal` always records how the sheet actually ended: `FlowCompleted` when the SDK closed it on its own, and the user's gesture when a post-claim or success screen kept it up and they closed it themselves.

The last three cases (`OfferClaimed`, `AppBackgrounded`, `AppTerminated`) are emission-only analytics values. `Outcome.dismissal` never carries them: a claim is advertiser-axis data, and the two lifecycle interruptions fire while the sheet is still up.

<Note>
  Reasons a sheet never appeared at all (`NoOffers`, `ExperimentControl`, `NotConfigured`, `AlreadyPresenting`, `NoForegroundActivity`, `UseCaseUnavailable`, `IapFirstDeclined`, `Error`) live on [`NotPresentedReason`](./presentation-result#notpresentedreason), not here.
</Note>

## Usage

Most apps never branch on the dismissal: the canonical check is on the claim and purchase facts, and every non-success falls through to the original flow.

```kotlin theme={null}
lifecycleScope.launch {
    val result = Encore.placement("cancel_flow").show()

    if (result.claim != null || result.publisher == PublisherOutcome.Purchased) {
        grantAccess()
    } else {
        result.dismissal?.let { analytics.track("offer_dismissed", it.value) }
        proceedWithCancellation()
    }
}
```

## Related

* [PresentationResult](./presentation-result), the record `dismissal` is one axis of
* [EncoreError](./errors), genuine failures carried as values on `NotPresented(NotPresentedReason.Error(...))`
