Skip to content

Integrating the Unreal Engine Braze SDK

Learn how to integrate the Unreal Engine Braze SDK into your Android or iOS app.

About the SDK

With the Braze Unreal SDK plugin, you can:

  • Measure and track sessions within your app or game
  • Track in-app purchases and custom events
  • Update user profiles with standard and custom attributes
  • Send push notifications
  • Integrate your Unreal apps with larger Canvas journeys
  • Send cross-channel messaging, like email or SMS, based on in-app behavior

Integrating the SDK

Step 1: Add the Braze plugin

In your terminal, clone the Unreal Engine Braze SDK GitHub repository.

1
git clone [email protected]:braze-inc/braze-unreal-sdk.git

Then, copy the BrazeSample/Plugins/Braze directory, and add it into your app’s Plugin folder.

Step 2: Enable the plugin

Enable the plugin for your C++ or Blueprint project.

For C++ projects, configure your module to reference the Braze module. In your \*.Build.cs file, add "Braze" to your PublicDependencyModuleNames.

1
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Braze" });

For Blueprint projects, go to Settings > Plugins, then next to Braze check Enabled.

EnablePlugin

Step 3: Set your API key and endpoint

Set your API key and endpoint in your project’s DefaultEngine.ini.

1
2
3
4
5
[/Script/Braze.BrazeConfig]
bAutoInitialize=True ; true by default, initialize when the project starts
AndroidApiKey= ; your API key
IOSApiKey= ; your API key
CustomEndpoint= ; your endpoint

Optional configurations

Logging

You can set the log level at runtime using C++ or in a Blueprint node.

To set the log level at runtime, call UBrazeSubsystem::AndroidSetLogLevel.

1
2
3
UBrazeSubsystem* const BrazeSubsystem = GEngine->GetEngineSubsystem<UBrazeSubsystem>();
BrazeSubsystem->AndroidSetLogLevel(EBrazeLogLevel::Verbose);
UBraze* const BrazeInstance = BrazeSubsystem->InitializeBraze();

In Blueprint, you can use the Android Set Log Level node:

The Android Set Log Level node in Blueprint.

In order to ensure logging is set when the Braze SDK Initialize is called, it is recommended to call this before InitializeBraze.

To enable the log level in the info.plist, go to Settings > Project Settings, then select iOS under Platforms. Under Extra PList Data, find Additional Plist Data, then enter your log level:

1
2
3
4
5
<key>Appboy</key>
<dict>
  <key>LogLevel</key>
  <string>0</string>
</dict>

The default log level is 8, which is minimal logging. Read more about log levels: Other SDK Customization

HOW HELPFUL WAS THIS PAGE?
New Stuff!