Bloomreach

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

Overview

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 provides an overview of the plugin configuration and functions available through the Median JavaScript Bridge.

👍

Developer Demo

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

Implementation Guide

Plugin Configuration

To configure your plugin update the following configuration parameters on the Push Notifications tab under Bloomreach:

{
    "active": true | false,
    "autoRegister": true | false, // if true push permission will be requested automatically
    "apiKey": "token abc123", // Required: Can be found in the Bloomreach Engagement dashboard
    "projectToken": "string value", // Required: Can be found in the Bloomreach Engagement dashboard
    "baseURL": "https://api.eu1.exponea.com",// Required: Can be found in the Bloomreach Engagement dashboard
    "hosts": ["median.dev", "median.com"] // Optional: A list of supported hosts for deep linking
}

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.

JavaScript Bridge Functions

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 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
}

Customer identification

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": “test_user@median.co” 
}; 
     
const result = await median.bloomreach.identifyCustomer(params);

With additional properties:

↔️Median JavaScript Bridge

const params = { 
  "identifier": "registered", 
  "value": "test_user@median.co" 
  "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 the current user.

Provide a callback function or otherwise returns a promise.

↔️Median JavaScript Bridge

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