SDK iOS Integration

Follow the below instructions to get Braze running in your Unity application. If you are transitioning from a manual integration, please read the instructions on Transitioning From a Manual to an Automated Integration.

Step 1: Choose your Braze Unity Package

The Braze .unitypackage bundles native bindings for the Android and iOS platforms, along with a C# interface.

There are several Braze Unity packages available for download at Braze Unity Releases Page:

  • Appboy.unitypackage
    • This package bundles the Braze Android and iOS SDKs as well as the SDWebImage dependency for the iOS SDK, which is required for proper functionality of Braze’s In-App Messaging, and Content Cards features on iOS. The SDWebImage framework is used for downloading and displaying images, including GIFs. If you intend on utilizing full Braze functionality, download and import this package.
  • Appboy-nodeps.unitypackage
    • This package is similar to Appboy.unitypackage except for the SDWebImage framework not being present. This package is useful if you do not want the SDWebImage framework present in your iOS app.

iOS: To see if you require the SDWebImage dependency for your iOS project, please visit the iOS In-App Message Documentation.

Android: As of Unity 2.6.0, the bundled Braze Android SDK artifact requires AndroidX dependencies. If you were previously using a jetified unitypackage, then you can safely transition to the corresponding unitypackage above.

Step 2: Import the Package

  1. In the Unity Editor, import the package into your Unity project by navigating to Assets > Import Package > Custom Package.
  2. Click Import.

Alternatively, follow the Unity instructions for Importing Asset packages for a more detailed guide on importing custom Unity packages.

Step 3b: Set Your API Key

Braze provides a native Unity solution for automating the Unity iOS integration. This solution modifies the built Xcode project using Unity’s PostProcessBuildAttribute) and subclasses the UnityAppController using the IMPL_APP_CONTROLLER_SUBCLASS macro.

  1. In the Unity Editor, open the Braze Configuration Settings by navigating to Braze > Braze Configuration.
  2. Check the “Automate Unity iOS Integration” box.
  3. In the “Braze API Key” field, input your application’s API key from the Braze Dashboard. Your Braze Configuration settings should look like this:

Braze Config Editor

If your application is already using another UnityAppController subclass, you will need to merge your subclass implementation with AppboyAppDelegate.mm.

Basic SDK Integration Complete

Braze should now be collecting data from your application and your basic integration should be complete.

Extending the SDK (iOS)

To extend the SDK’s behaviors, fork our Braze Unity SDK Github project and make your required changes.

To publish your modified code as a Unity package, see Advanced Use Cases.

Transitioning from Manual to Automated Integration (iOS)

To take advantage of the automated iOS integration offered in the Braze Unity SDK, follow these steps on transitioning from a manual to an automated integration.

  1. Remove all Braze-related code from your Xcode project’s UnityAppController subclass.
  2. Remove Braze’s iOS libraries from your Unity or Xcode project (i.e., Appboy_iOS_SDK.framework and SDWebImage.framework) and import the Braze Unity package into your Unity project.
  3. Follow the integration instructions on setting your API key through Unity.
WAS THIS PAGE HELPFUL?
New Stuff!