# In-App Experiences for the Cordova 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.

```javascript
// Pause in-app experiences
Airship.inApp.setPaused(true)

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

// Check if paused
Airship.inApp.isPaused((isPaused) => {
  console.log('Is paused:', 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.

```javascript
Airship.takeOff({
  production: {
    appKey: "<APP_KEY>",
    appSecret: "<APP_SECRET>"
  },
  development: {
    appKey: "<APP_KEY>",
    appSecret: "<APP_SECRET>"
  },
  inProduction: true,
  site: "us",
  autoPauseInAppAutomationOnLaunch: true
})
```


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

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

```javascript
Airship.inApp.setPaused(false)
```


## Display Interval

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

```javascript
// Set display interval to 5 seconds
Airship.inApp.setDisplayInterval(5000)

// Get current display interval
Airship.inApp.getDisplayInterval((interval) => {
  console.log('Display interval:', interval)
})
```


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

