Xtremepush

Engage your users by enabling Xtremepush push notifications

The Xtremepush Plugin enables the integration of mobile push notifications within your app. With support for audience segmentation and targeted messaging, this plugin leverages the capabilities of the Xtremepush iOS SDK and Xtremepush Android SDK to enhance user engagement.

This guide provides detailed instructions on configuring the plugin and using its available functions through the Median JavaScript Bridge.

Implementation Guide

Plugin Configuration

To configure the plugin, update the following parameters in the Native Plugins tab under Xtremepush:

{
  "active": true | false,
  "appKey": STRING, 
  "googleProjectId": STRING
}

Deep Linking

Enable Deep Linking to ensure that notification links open directly within your app instead of the device's browser.

JavaScript Bridge Functions

Initialize

If automatic initialization is not configured in App Studio, manually initialize Iterable with your API Key.

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

Verify if the Iterable SDK 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
}

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 permissions from the user. On Android 13 and above, a dialog appears; on Android 12 and below, permissions are granted automatically.

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

Retrieve the current push notification permission status.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

Set Email or Set User Id

Identify the user in Iterable. After setting, call 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
}