# In-App Experiences for the Flutter Plugin

Pause, resume, and control display timing for In-App Experiences.

In-App Experiences are automatically enabled when you integrate the Airship SDK. Use these methods to control when and how they are displayed.

## Pausing and Resuming Display

You can pause and resume In-App Experiences to control when they are displayed to users.

```dart
// Pause in-app experiences
await Airship.inApp.setPaused(true);

// Resume in-app experiences
await Airship.inApp.setPaused(false);

// Check if paused
bool isPaused = await Airship.inApp.isPaused();
```


### Auto-Pause on Launch

You can configure the SDK to automatically pause In-App Experiences on launch. This is useful if you want to defer showing In-App Experiences until after onboarding or other critical app flows.

```dart
var config = AirshipConfig(
  defaultEnvironment: ConfigEnvironment(
    appKey: "YOUR_APP_KEY",
    appSecret: "YOUR_APP_SECRET"
  ),
  site: Site.us,
  autoPauseInAppAutomationOnLaunch: true
);

Airship.takeOff(config);
```


See the [Flutter Setup guide](https://www.airship.com/docs/developer/sdk-integration/flutter/installation/getting-started/) for complete `takeOff` configuration options.

When you're ready to display In-App Experiences, call `setPaused(false)`:

```dart
await Airship.inApp.setPaused(false);
```


## Display Interval

Control the minimum time between In-App Experience displays to avoid overwhelming users.

```dart
// Set display interval to 5 seconds (5000 milliseconds)
await Airship.inApp.setDisplayInterval(5000);

// Get current display interval
int interval = await Airship.inApp.getDisplayInterval();
```


The display interval is the minimum time (in milliseconds) that must pass between displaying In-App Experiences.

