SDK iOS integration
This reference article covers the iOS SDK integration for the Unity platform. Follow these guide to get Braze running in your Unity application.
If you are transitioning from a manual integration, read the instructions on Transitioning 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 on the Braze Unity releases page:
Appboy.unitypackage
- This package bundles the Braze Android and iOS SDKs and the SDWebImage dependency for the iOS SDK, which is required for the 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 is not present. This package is useful if you do not want the SDWebImage framework present in your iOS app.
- This package is similar to
iOS: To see if you require the SDWebImage dependency for your iOS project, 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
.
Step 2: Import the package
In the Unity Editor, import the package into your Unity project by navigating to Assets > Import Package > Custom Package. Next, click Import.
Alternatively, follow the Unity asset package import instructions for a more detailed guide on importing custom Unity packages.
If you only wish to import the iOS or Android plugin, deselect the Plugins/Android
or Plugins/iOS
subdirectory when importing the Braze .unitypackage
.
Step 3: 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.
- In the Unity Editor, open the Braze Configuration Settings by navigating to Braze > Braze Configuration.
- Check the Automate Unity iOS Integration box.
- In the Braze API Key field, input your application’s API key found in Manage Settings.
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. For more information on integrating push, check out the following articles: Android and iOS, in-app messages, and Content Cards.
To learn about advanced SDK integration options, check out Advanced Implementation.