Configuration

Update the following parameters on the Push Notifications tab under Iterable:

{
  "active": true | false,
  "autoRegister": true | false, // optional, if true push permission will be requested automatically
  "apiKey": STRING, // if specified initialization will initiate automatically, otherwise provide when initializing at runtime via JavaScript Bridge
  "dataRegion": STRING // if specified (e.g. 'EU') the app will use region-specific endpoints, can also be provided when initializing at runtime via JavaScript Bridge
}

👍

Developer Demo

Display our demo page in your app to test during development https://median.dev/iterable/

Deep Linking

Set up Deep Linking within your app and notification links will automatically open directly into your app.

JavaScript Bridge Functions

Initialize

Initialize Iterable with your API Key if your app is not configured within the App Studio for automatic initialization.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

median.iterable.initialize({
  'apiKey': STRING,
  'dataRegion': STRING, // optional, e.g. 'EU'
  'callback': function // optional otherwise returns promise
});
// Return value:
{
  "success": true | false
}

Check if Initialized

Check if the Iterable SDK is initialized to avoid duplicate initialization.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

median.iterable.isInitialized({'callback': function});
// Return value:
{
  'initialized': true | false,
  'apiKey': STRING, // available only if initialized is true
  'dataRegion': STRING // available only if initialized is true
}

Set Email or Set User Id

Identify the user with Iterable. After setting run registerForPush() to generate a new token.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

median.iterable.setEmail({
  'email': STRING,
  'callback': function // optional otherwise returns promise
});
// Return value:
{
  "success": true | false
}

median.iterable.setUserId({
  'userId': STRING,
  'callback': function
});
// Return value:
{
  "success": true | false
}

Register for Push Notifications

Register the current user for push notifications and generate a new token.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

median.iterable.registerPush({'callback': function});
// Return value:
{
  "success": true | false
}

Prompt for Push Notification Permission

Request Push Notification permission, which will show a dialog for users to confirm permission. For Android, the dialog is only shown on Android 13 and above. On Android 12 and below, permission will always be granted without user intervention.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

median.iterable.requestPermission({'callback': function});
// Return value:
{
  "granted": true | false
}

Check Push Notification Permission Status

Obtain Push Notification permission status.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

median.iterable.permissionStatus({'callback': function});
// Return value:
{
  "granted": true | false
}