Braze
Enabling Push Notifications
Enable using Braze In-App Messaging functionality documented at https://www.braze.com/docs/user_guide/message_building_by_channel/push/push_primer_messages/.
Or enable using the GoNative JavaScript Bridge function gonative.braze.promptNotification()
documented below.
Deep Linking
Set up Deep Linking within your app and notification links will automatically open directly into your app.
JavaScript Bridge Functions
Change User
Register a new user or login an existing user
↔️GoNative JavaScript Bridge
gonative.braze.changeUser({'userId': STRING})
Prompt for Push Notification Permission
Request 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.
↔️GoNative JavaScript Bridge
gonative.braze.promptNotification({'callback': function}) // Return value: { "granted": true | false }
Check Push Notification Permission
Checks 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 be granted.
Provide a callback function or otherwise returns a promise.
↔️GoNative JavaScript Bridge
gonative.braze.notificationEnabled({'callback': function}) // Return value: { "granted": true | false }
Testing Notifications and Deep Linking
-
On the Braze Dashboard, navigate to the Campaigns tab under Engagement, then click Create Campaign and select Push Notification
-
Scroll down and click Android Push or iOS Push accordingly.
-
Input a Title and Message then scroll down and select the type of notification Push Notification Body.
Open App - Opens app when notification is clicked, does nothing if App is already opened.
Deep Link Into Application - Input a URL which your app will load when the notification is clicked by the user. Ensure that Deep Linking is correctly configured for your app. -
Send the notification to a test user by navigating to the Test tab and adding the test users then click Send Test.
Note: So that users are listed ensure you callgonative.braze.changeUser({userId:String})
.
Updated 29 days ago