Braze

Engage your users by enabling Braze push notifications and event tracking

The Braze Plugin integrates mobile push notifications and in-app event tracking to boost user engagement and strengthen data analytics. It also supports audience segmentation and targeted messaging by leveraging the Braze iOS SDK and Braze Android SDK.

Why use this plugin

  • Push notifications: Enable push messaging workflows in your app.
  • Event tracking: Send custom events to Braze for analytics and campaign logic.
  • User targeting: Support segmentation and targeted messaging.
  • Deep linking support: Open notification links directly in your app when deep linking is configured.
👍

Developer Demo

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


Prerequisites

  • Access to the Braze plugin settings in the Median App Dashboard (Push Notifications tab).
  • Braze credentials and endpoints for your platforms:
    • iosApiKey
    • iosEndpointKey
    • androidApiKey
    • androidEndpointKey
    • firebaseSenderId
  • If using automatic prompts, set autoRegister in plugin config.
  • If testing with the Median demo page, use https://median.dev/braze/.

When to use this plugin

Braze is useful for apps that need to:

Use CaseExample
Prompt for notification permissionAsk users for push permission from app UI using the JavaScript Bridge.
Check notification permission statusVerify if push is enabled before sending users into push-dependent flows.
Identify users in BrazeRegister or switch the active user with changeUser.
Track custom eventsSend named events with properties for segmentation and campaign triggers.
Open notification links in-appRoute push deep links directly into app content after deep linking setup.

What You'll Do

Use this section as a fast navigation map into the full setup and implementation details:

  1. Configure Braze plugin settings: Go to Plugin Setup and set required API and endpoint keys.
  2. Set push permission behavior: Decide whether to use autoRegister or prompt at a controlled time with median.braze.promptNotification().
  3. Implement bridge methods: Add core methods in JavaScript Bridge Functions.
  4. Validate event and permission flows: Use Code Examples to test practical integration patterns.
  5. Verify notification and deep link behavior: Complete Testing Checklist and review Troubleshooting.

Implementation Guide

Plugin Setup

Configure the plugin by updating the following parameters under the Push Notifications tab in Braze:

{
  "active": true,
  "autoRegister": true,
  "iosApiKey": "STRING",
  "iosEndpointKey": "sdk.xyz-##.braze.com",
  "androidApiKey": "STRING",
  "androidEndpointKey": "sdk.xyz-##.braze.com",
  "firebaseSenderId": "STRING"
}

Enable push notifications

Enable push notifications through Braze In-App Messaging as documented in the Braze push primer.

To request the push notification permission from your users, use the Median JavaScript Bridge function median.braze.promptNotification() as documented below. Alternatively, set autoRegister to true in the configuration JSON for automatic permission requests.

Deep linking

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


JavaScript Bridge Functions

Change User

Logs in an existing user or registers a new user in Braze context.

↔️Median JavaScript Bridge

median.braze.changeUser({ userId: "user_123" });

Parameters:

ParameterTypeRequiredDescription
userIdstringYesUser identifier to associate with the Braze profile.

Prompt for Push Notification Permission

Prompts users to enable push notifications.

↔️Median JavaScript Bridge

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

Parameters:

ParameterTypeRequiredDescription
callbackfunctionNoCallback that receives { granted: true | false }.

Check Push Notification Permission

Checks if push notification permission has been granted.

↔️Median JavaScript Bridge

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

Parameters:

ParameterTypeRequiredDescription
callbackfunctionNoCallback that receives { granted: true | false }.

Track Custom Events

Sends a custom event to Braze.

Note: Custom Events must be added in the Braze Dashboard.


↔️Median JavaScript Bridge

median.braze.logCustomEvent("YOUR-EVENT-NAME", {
  "key1": value1,
  "key2": value2,
  ...
});

Parameters:

ParameterTypeRequiredDescription
eventNamestringYesCustom event name (must exist in Braze dashboard).
propertiesobjectNoEvent key-value payload.

Testing Checklist

Use this checklist to validate Braze integration:

  • Braze plugin configuration is set (including active, platform API keys, and endpoint keys).
  • median.braze.changeUser({ userId }) is called for the active test user.
  • median.braze.promptNotification() returns a permission result.
  • median.braze.notificationEnabled() returns current permission state.
  • median.braze.logCustomEvent() is called with a known event name.
  • Test notifications are sent to a test user from Braze (Test tab).
  • Notification opens app when configured as Open App.
  • Notification routes to the intended URL when configured as Deep Link Into Application.
  • Deep linking is configured in the app so links open in-app.

Troubleshooting

Ensure your app calls median.braze.changeUser({ userId: "..." }) so the user is identified before sending test notifications.

Confirm deep linking is set up in your app. Notification links rely on the app’s deep linking configuration.

On Android 13 and above, explicit permission is required. On Android 12 and below, permissions are granted automatically.

📘

Still having trouble?

For issues related to Iretable's own configuration, permissions, or platform-specific behavior outside Median.co's, refer to Braze's integration documentation.