Push notifications
Learn how to set up push notifications for the Unreal Engine Braze SDK.
Prerequisites
Before you can use this feature, you’ll need to integrate the Unreal Engine Braze SDK.
Setting up push notifications
Step 1: Set up your project
First, add Firebase to your Android project. For step-by-step instructions, see Google’s Firebase setup guide.
Before you can send an iOS push notification using Braze, you must provide your .p8
push notification file provided by Apple. As described on the Apple developer documentation:
- In your Apple developer account, go to Certificates, Identifiers & Profiles.
- Under Keys, select All and click the add button (+) in the upper-right corner.
- Under Key Description, enter a unique name for the signing key.
- Under Key Services, select the Apple Push Notification service (APNs) checkbox, then click Continue. Click Confirm.
- Note the key ID. Click Download to generate and download the key. Make sure to save the downloaded file in a secure place, as you cannot download this more than once.
- In Braze, go to Settings > App Settings and upload the
.p8
file under Apple Push Certificate. You can upload either your development or production push certificate. To test push notifications after your app is live in the App Store, its recommended to set up a separate workspace for the development version of your app. - When prompted, enter your app’s bundle ID, key ID, and team ID, then click Save.
If you are using the older navigation, you can upload your .p8
file from Manage Settings > Settings.
Step 2: Enable push notifications
Add the following lines to your project’s engine.ini
file. Be sure to replace YOUR_SEND_ID
with the Sender ID in your Firebase Project.
1
2
3
bEnableFirebaseCloudMessagingSupport=true
bIsFirebaseCloudMessagingRegistrationEnabled=true
FirebaseCloudMessagingSenderIdKey=YOUR_SENDER_ID
Within the same directory as BrazeUPLAndroid.xml, create a new directory named AndroidCopies
and add your google-services.json
file to it.
In your project, go to Settings > Project Settings > iOS > Online then check Enable Remote Notifications Support. When you’re finished, verify that your provision has push capabilities enabled.
To enable push capabilities for iOS, your project must have been built from source. For more information, see Unreal Engine: Building from source.
Optional configurations
Setting small and large icons
To set the small and large notification icons:
- Add icons to the appropriate drawable folder (
drawable
by default) inside of theAndroidCopies/res
folder. - Add
braze.xml
to theAndroidCopies/res/values
folder to set the icons. A very basic braze.xml file:1 2 3 4 5
<?xml version="1.0" encoding="utf-8"?> <resources> <drawable name="com_braze_push_small_notification_icon">@drawable/notification_small_icon</drawable> <drawable name="com_braze_push_large_notification_icon">@drawable/notification_large_icon</drawable> </resources>
The files from the AndroidCopies
folder will be copied into the generated Android project structure as defined in the BrazeUPLAndroid.xml
.
Remote launch notifications
As of Unreal Engine version 4.25.3, UE4 lacks proper support to receive a remote notification that causes the initial launch of the application. In order to support receiving this notification, we’ve created two git patches to apply - one for UE4 and one for the Braze SDK plugin.
- In your UE4 Engine
Source
directory, apply the git patchUE4_Engine-Cache-Launch-Remote-Notification.patch
. - In your Braze Unreal SDK directory, apply the git patch
Braze_SDK-Read-Cached-Remote-Launch-Notification.patch
.