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 DemoDisplay 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:
iosApiKeyiosEndpointKeyandroidApiKeyandroidEndpointKeyfirebaseSenderId
- If using automatic prompts, set
autoRegisterin 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 Case | Example |
|---|---|
| Prompt for notification permission | Ask users for push permission from app UI using the JavaScript Bridge. |
| Check notification permission status | Verify if push is enabled before sending users into push-dependent flows. |
| Identify users in Braze | Register or switch the active user with changeUser. |
| Track custom events | Send named events with properties for segmentation and campaign triggers. |
| Open notification links in-app | Route 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:
- Configure Braze plugin settings: Go to Plugin Setup and set required API and endpoint keys.
- Set push permission behavior: Decide whether to use
autoRegisteror prompt at a controlled time withmedian.braze.promptNotification(). - Implement bridge methods: Add core methods in JavaScript Bridge Functions.
- Validate event and permission flows: Use Code Examples to test practical integration patterns.
- 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | User 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
callback | function | No | Callback 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
callback | function | No | Callback 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
eventName | string | Yes | Custom event name (must exist in Braze dashboard). |
properties | object | No | Event key-value payload. |
Testing Checklist
Use this checklist to validate Braze integration:
Basic Functionality
- 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.
Push and Deep Linking
- 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
Test users are not appearing in Braze test send flow
Ensure your app calls median.braze.changeUser({ userId: "..." }) so the user is identified before sending test notifications.
Push deep links open incorrectly
Confirm deep linking is set up in your app. Notification links rely on the app’s deep linking configuration.
Permission prompt behavior differs on Android versions
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.
Updated 10 days ago