Bloomreach

Engage your users by enabling Bloomreach push notifications and in-app messaging.

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

This guide covers plugin configuration, implementation steps, and available JavaScript Bridge functions using the Median JavaScript Bridge.

👍

Developer Demo

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

Implementation Guide

Configure Plugin Settings

Navigate to the Push Notifications tab under the Bloomreach Plugin settings in your Median App Dashboard. Add the following configuration:

{
    "active": true | false, 									// Required
    "autoRegister": true | false, 						// Required
    "apiKey": "token abc123", 								// Required
    "projectToken": "string value", 					// Required
    "baseURL": "https://api.eu1.exponea.com",	// Required
    "hosts": ["median.dev", "median.com"] 		// Optional
}
  • active : Enables or disables the plugin.
  • autoRegister: Automatically prompts users for push permission on app launch.
  • apiKey, projectToken, and baseURL: Retrieve these from your Bloomreach Engagement dashboard.
  • hosts: Optional. Add your domain(s) to support deep links.

Android Push Notifications

Android push notifications are sent using Firebase Cloud Messaging and require a google-services.json to be embedded in the app. You can do so by uploading your own file in the Build & Download tab. Push notifications must also be enabled within your Bloomreach Engagement web app by adding the FCM server key.

Refer to the Bloomreach Documentation for a step by step on the Bloomreach setup.

Deep Linking Setup

To support deep linking:

  1. Update hosts parameter in the plugin config:
    Add the domains you want to support for deep links (Don’t add https:// or http:// , as the plugin will always use these schemes).
  2. Host verification files on your deep linking domain(s):

📘

Need help?

Use the Deep Linking Validator and check our Deep Linking Documentation.

Please note that incorrect configuration can cause deep links to open in the browser (e.g., Chrome/Safari) instead of your app.

JavaScript Bridge Functions

Request Push Notification Permission

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

Provide a callback function or otherwise returns a promise.

↔️Median JavaScript Bridge

median.bloomreach.promptNotification({'callback': function})
// Return value:
{
  "granted": true | false
}

Check Push Notification Permission

Determine if the user has granted Push Notification permission. For Android must be checked first to ensure that Push Notification will show on Android 13 and above. Android 12 and below will always return true.

Provide a callback function or otherwise returns a promise.

↔️Median JavaScript Bridge

median.bloomreach.notificationEnabled({'callback': function})
// Return value:
{
  "granted": true | false
}

Identify Customer

Identify the customer using an Id. This state persists across multiple app sessions until the logout method is called

↔️Median JavaScript Bridge

const params = { 
  "identifier": “registered”, 
  "value": “[email protected]” 
}; 
     
const result = await median.bloomreach.identifyCustomer(params);

Optionally, include user properties:

↔️Median JavaScript Bridge

const params = { 
  "identifier": "registered", 
  "value": "[email protected]", 
  "properties": { 
     "first_name": "John", 
     "last_name": "Doe", 
     "age": 25 
  } 
}

📘

Note

While the hard ID used in this example is named registered (the default hard_id value), your hard ID may differ. For more information and to identify the correct identifier for your use case, refer to the following links: Bloomreach Documentation Customer Identification, Bloomreach User Tracking

Logout Customer

Clear the current customer session.

Provide a callback function or otherwise returns a promise.

↔️Median JavaScript Bridge

median.bloomreach.logoutCustomer({callback: function})
// Return value:
{
  "success": BOOLEAN
}