Bloomreach
Engage your users by enabling Bloomreach push notifications and in-app messaging
The Bloomreach 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 Bloomreach iOS SDK and Bloomreach Android SDK to enhance user engagement.
Display our demo page in your app to test during development https://median.dev/bloomreach/
Why use Bloomreach?
- Push permission control: Request and check notification permission from JavaScript.
- Customer identity support: Identify and persist customer state across sessions.
- Customer logout support: Clear customer session state when needed.
- Deep linking readiness: Configure domains to route links into the app.
Prerequisites
- Access to Bloomreach plugin settings in Median App Studio (Native Plugins tab).
- Bloomreach credentials from your Bloomreach Engagement dashboard:
apiKeyprojectTokenbaseURL
- For Android push, plan Firebase Cloud Messaging (FCM) with
google-services.jsonand Bloomreach; see Android push notifications. - For deep linking, plan domains for
hostsand host platform verification files; see Deep linking setup.
Integration guide
Plugin setup
Enable the Plugin
- In the Median App Studio, open Bloomreach plugin settings under Push Notifications.
- Set
activetotrue. - Add required values:
apiKey,projectToken, andbaseURL. - Configure
autoRegisterfor automatic permission prompting on app launch. - Add optional
hostsvalues for deep linking support.
Configuration Options
| Setting | Description | Default | Recommended |
|---|---|---|---|
| active | Enables or disables the plugin. | N/A — not covered in the source. | true for active integrations. |
| autoRegister | Automatically prompts users for push permission on app launch. | N/A — not covered in the source. | false to enable manual permission timing. |
| apiKey | Bloomreach API key (required). | N/A — not covered in the source. | Use the value from the Bloomreach dashboard. |
| projectToken | Bloomreach project token (required). | N/A — not covered in the source. | Use the value from the Bloomreach dashboard. |
| baseURL | Bloomreach API base URL (required). | N/A — not covered in the source. | Use your regional Bloomreach endpoint. |
| hosts | An optional domain allowlist for deep links. | N/A — not covered in the source. | Add all app deep-link domains without scheme (https:///http://). |
Example configuration (JSON)
{
"active": true,
"autoRegister": false,
"apiKey": "your-api-key",
"projectToken": "your-project-token",
"baseURL": "https://api.eu1.exponea.com",
"hosts": ["median.dev", "median.com"]
}Replace values with those from your Bloomreach Engagement project and your app’s domains.
Android push notifications
Android deliver push through Firebase Cloud Messaging (FCM). Configure all of the following:
google-services.json— Embed the Firebase config in your build. In Median App Studio, open the Build & Deploy tab and upload yourgoogle-services.jsonso it is included in the app binary.- Bloomreach Engagement — In the Bloomreach Engagement web app, enable push for your project and add your FCM server key so Bloomreach can send notifications to your app.
For Bloomreach-side steps (projects, keys, and campaigns), use Bloomreach’s documentation.
Deep linking setup
Deep links open URLs in your app when domains are allowlisted and platform association files are valid.
- Plugin configuration — Add every domain you want to open in-app to the
hostsarray. Do not includehttps://orhttp://; the plugin applies URL schemes as needed. - Hosted verification files — On each domain (and subdomain you use), serve the standard association files over HTTPS:
- Android —
/.well-known/assetlinks.json(format and examples: Deep linking). Example host file: https://median.dev/.well-known/assetlinks.json. - iOS —
/.well-known/apple-app-site-association(or/apple-app-site-association). Example: https://median.dev/.well-known/apple-app-site-association.
- Android —
Use median.co’s Deep Linking Validator to check your domain, and read Deep linking for Universal Links, App Links, and file requirements.
Note
An incorrect deep link setup can cause links to open in the browser instead of the app.
JavaScript Bridge Functions
Request Push Notification Permission
Prompt for the Push Notification permission, which displays a dialog for users to confirm permission. For Android, the dialog only displays on Android 13 and above. Android 12 and below will always be granted without user intervention.
Provide a callback function or otherwise return a promise.
median.bloomreach.promptNotification({'callback': function})
// Return value:
{
"granted": true | false
}Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
callback | function | No | Callback that receives { granted: true | false }. |
Check push notification permission
Checks whether push permission is granted.
median.bloomreach.notificationEnabled({'callback': function})
// Return value:
{
"granted": true | false
}Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
callback | function | No | Callback that receives { granted: true | false }. |
Identify customer
Identifies a customer by identifier and value. State persists until logout.
const params = {
identifier: "registered",
value: "[email protected]",
};
const result = await median.bloomreach.identifyCustomer(params);Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | Customer identifier key (example in source: registered). |
value | string | Yes | Identifier value (example: email). |
properties | object | No | Optional customer properties such as first_name, last_name, age. |
Optionally, include user properties:
const params = {
identifier: "registered",
value: "[email protected]",
properties: {
first_name: "John",
last_name: "Doe",
age: 25,
},
};Logout customer
Clears the current customer session.
median.bloomreach.logoutCustomer({callback: function})
// Return value:
{
"success": BOOLEAN
}Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
callback | No | function | Callback for logout completion. |
async function ensureBloomreachPermission() {
const status = await median.bloomreach.notificationEnabled();
if (!status.granted) {
const result = await median.bloomreach.promptNotification();
console.log("Permission granted:", result.granted);
}
}Identify and later clear a customer session
async function setAndClearCustomer() {
await median.bloomreach.identifyCustomer({
identifier: "registered",
value: "[email protected]",
properties: {
first_name: "John",
last_name: "Doe",
age: 25,
},
});
await median.bloomreach.logoutCustomer();
}Testing Checklist
Use this checklist to validate Bloomreach integration:
Basic Functionality
- Plugin is active and required config values are set.
-
promptNotificationreturns a permission result. -
notificationEnabledreturns current permission state. -
identifyCustomeris called with valid identifier/value. -
logoutCustomerclears the current customer session.
Configuration Testing
- Android app includes
google-services.json. - Bloomreach push setup includes FCM server key.
-
hostsincludes all intended deep-link domains. - Verification files are hosted for iOS and Android deep linking.
Deep Linking"
- Deep links open in-app for configured domains.
- Deep Linking Validator checks pass.
Troubleshooting
Why do deep links open in the browser instead of the app?
Why do deep links open in the browser instead of the app?
This typically indicates incorrect deep linking configuration. Verify hosted association files and ensure all intended domains are listed in hosts (without https:// or http://).
Why aren't Android push notifications being delivered?
Why aren't Android push notifications being delivered?
Verify google-services.json is embedded in the app and Bloomreach push configuration includes the FCM server key.
Which identifier should I use in identifyCustomer?
Which identifier should I use in identifyCustomer?
The source notes that registered is the default hard ID in the example, but your hard ID may differ. Check your Bloomreach customer identification setup.
Still having trouble?For issues related to Bloomreach's own configuration, permissions, or platform-specific behavior outside Median.co's, refer to Bloomreach's integration documentation.
Updated 5 days ago