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

# Iterable

> Add Iterable push notifications to your app, then initialize the SDK, request permission, and identify users with the JavaScript Bridge.

The Iterable plugin connects your app to Iterable’s iOS and Android SDKs ([Overview of Iterable's iOS and Android SDKs](https://support.iterable.com/hc/en-us/articles/360028925511-Overview-of-Iterable-s-iOS-and-Android-SDKs/)) for push delivery, audience targeting, and user identification.

Configure the plugin in Median App Studio (including API key and optional data region), then use the [Median JavaScript Bridge](https://docs.median.co/docs/javascript-bridge.md) to initialize the SDK when needed, register for push, request permission, and identify users by email or user ID.

> [!TIP]
>
> **Test  with our demo page**
>
> We host a ready-made demo page at
>
> that calls the  features through the Median JavaScript Bridge.
> Load it inside your Median app during development, either by setting it
> as your app's website URL in App Studio or by navigating to it from your
> own site, and use it to confirm  works on a real device before
> you add it to your own pages.
>
> The demo page only works inside a Median app with  enabled.
> Opened in a regular mobile or desktop browser, the native features
> won't respond. Remember to switch your app back to your own URL before
> release.

## Why use Iterable

* **Push delivery**: Send Iterable campaigns to devices through the native push channel.
* **Segmentation and targeting**: Align push with Iterable audiences and campaign logic.
* **Flexible initialization**: Supply `apiKey` in App Studio for automatic setup, or call `initialize` at runtime when you need dynamic configuration.
* **User identification**: Tie devices to Iterable profiles with `setEmail` or `setUserId`, then refresh the push token with `registerPush` as documented by Iterable.

## Prerequisites

* [ ] A Median app with the JavaScript Bridge enabled
* [ ] Access to **Native Plugins → Iterable** in App Studio
* [ ] An Iterable API key and (if applicable) a data region such as `EU`
* [ ] `google-services.json` uploaded to your app (see [Google Services](https://docs.median.co/docs/google-services.md))
* [ ] Deep linking enabled in the app if notification URLs should open in-app

## Integration guide

### Plugin setup

#### Enable the plugin

1. **Navigate to Native Plugins**: In App Studio, open **Native Plugins** and select Iterable.
2. **Enable Iterable**: Turn the plugin on and fill in the settings below.
3. **Add `google-services.json`**: Iterable requires [`google-services.json`](https://docs.median.co/docs/google-services).
4. **Enable deep linking**: Set up [deep linking](https://docs.median.co/docs/deep-linking) so notification links open in your app rather than the device browser.

#### Configuration options

| Setting | Description |
| - | - |
| **API Key (Optional)** | If set, the Iterable SDK is initialized automatically. |
| **Data Region** | **US** or **EU**. Match your Iterable project's data residency. Defaults to **US**. |
| **Automatic Registration** | When set to **Enable**, push permission is requested automatically. Enabled by default. |

If you leave **API Key** empty, call `median.iterable.initialize()` from your web app with your API key and optional `dataRegion` before relying on other JavaScript Bridge methods.

### JavaScript Bridge functions

#### Initialize

Manually initializes the Iterable SDK when you are not relying on automatic initialization from App Studio config.

Median JavaScript Bridge

```javascript JavaScript theme={null}
// Omit callback to use the returned promise
median.iterable.initialize({
  apiKey: "YOUR_ITERABLE_API_KEY",
  dataRegion: "EU", // optional
  callback: function (result) {
    // result.success is true or false
    console.log(result.success);
  }
});
```

**Parameters:**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | `string` | Yes | Iterable API key |
| `dataRegion` | `string` | No | Region string when using a regional endpoint (for example `EU`) |
| `callback` | `function` | No | Optional callback; omit to use the returned promise |

#### Check permission status

Returns whether the Iterable SDK has been initialized and, when initialized, echoes the active `apiKey` and `dataRegion`.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.iterable.isInitialized().then(function (result) {
  // result.initialized is true or false
  // result.apiKey and result.dataRegion are only set when initialized is true
  console.log(result);
});
```

**Parameters:**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `callback` | `function` | No | Optional callback; omit to use the returned promise |

#### Register push

Registers the current user for push notifications and refreshes the device token.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.iterable.registerPush().then(function (result) {
  // result.success is true or false
  console.log(result.success);
});
```

**Parameters:**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `callback` | `function` | No | Optional callback; omit to use the returned promise |

#### Request permission

Prompts the user for push notification permission.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.iterable.requestPermission().then(function (result) {
  // result.granted is true or false
  console.log(result.granted);
});
```

**Parameters:**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `callback` | `function` | No | Optional callback; omit to use the returned promise |

#### Set email

Identifies the current user by email in Iterable. After a successful call, invoke `registerPush` to generate a new token for that profile.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.iterable.setEmail({
  email: "user@example.com"
}).then(function (result) {
  // result.success is true or false
  console.log(result.success);
});
```

**Parameters:**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | User email associated with the Iterable profile |
| `callback` | `function` | No | Optional callback; omit to use the returned promise |

#### Set user ID

Identifies the current user by user ID. After a successful call, invoke `registerPush` to generate a new token for that profile.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.iterable.setUserId({
  userId: "user-123"
}).then(function (result) {
  // result.success is true or false
  console.log(result.success);
});
```

**Parameters:**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | Yes | Your application’s user identifier |
| `callback` | `function` | No | Optional callback; omit to use the returned promise |

### Testing checklist

Use this checklist to ensure Iterable is working correctly in your app:

**Basic functionality**

* [ ] The plugin is enabled in **Native Plugins**, with a valid **API Key** and the correct **Data Region** when applicable
* [ ] `median.iterable.isInitialized()` reflects the expected state after App Studio config or `initialize()`
* [ ] `median.iterable.requestPermission()` (or **Automatic Registration**) yields the expected permission outcome
* [ ] `median.iterable.registerPush()` completes with `success: true` after permission is granted

**Platform testing**

* [ ] Push registration and receipt behave on Android test devices
* [ ] Push registration and receipt behave on iOS test devices
* [ ] Iterable test sends reach the device after `setEmail` / `setUserId` and `registerPush`

**Error scenarios**

* [ ] Failed `initialize` or `registerPush` paths do not leave the app in a broken state (retry or messaging as needed)
* [ ] Behavior is sane when permission is denied (no silent assumptions that push is enabled)

**Edge cases**

* [ ] Runtime `initialize` with `apiKey` / `dataRegion` matches your Iterable project
* [ ] User switching (`setEmail` / `setUserId` changes) is followed by `registerPush` so tokens stay aligned

**User experience**

* [ ] Permission prompts appear at a sensible time relative to your onboarding
* [ ] Deep-linked notification opens land on the correct in-app destination

## Troubleshooting

### Why are Iterable JavaScript Bridge functions undefined or not working?

Confirm the JavaScript Bridge is enabled in App Studio, call JavaScript Bridge APIs after the `median_library_ready()` event, and verify Iterable is enabled under **Native Plugins**.

### Why is `isInitialized` false, or why does initialize keep failing?

Check that the **API key** and optional **data region** match your Iterable project. If you rely on runtime initialization, ensure `median.iterable.initialize()` runs before other Iterable calls and that network access is available.

### Why aren't test notifications reaching the device?

Ensure you have called `setEmail` or `setUserId` for the test profile, then `registerPush`, and that the user has granted notification permission. Confirm the device is registered in Iterable for that identifier.

### Why do notification links open in the browser instead of the app?

Enable and configure **Deep linking** for your Median app so URLs from Iterable notifications route in-app. Verify URL patterns match your app’s deep link configuration.

### Why isn't my EU data region working correctly?

If your Iterable workspace uses the EU stack, set `dataRegion` (for example `EU`) consistently in App Studio config or in `initialize()` so the SDK talks to the correct endpoints.

> [!NOTE]
>
> **Still having issues?**
>
> For issues related to Iterable's own configuration, permissions, or platform-specific behavior outside of Median, refer to the [Iterable integration documentation](https://support.iterable.com/hc/en-us/articles/360035079872-Push-Notification-Overview).


## Related topics

- [Changelog archive](https://docs.median.co/docs/changelog-archive.md)
- [Changelog](https://docs.median.co/docs/changelog.md)
- [App architecture](https://docs.median.co/docs/architecture.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.