Manual Integration Options
We strongly recommend that you implement the SDK via a CocoaPod. It will save you a lot of time and automate much of the process for you. However, if you are unable to do so you may complete integration manually without CocoaPods by using our manual integration instructions below.
Manual SDK Integration
Step 1: Cloning the Braze SDK
- Clone the Braze iOS SDK Github project:
1 2 # This command will clone both versions of the Braze SDK $ git clone firstname.lastname@example.org:Appboy/appboy-ios-sdk.git
- In Xcode, from the project navigator, select the destination project or group for Braze
- Navigate to File > Add Files to “Project_Name”
- Add the
AppboyUIfolders to your project as a group.
- Make sure that the “Copy items into destination group’s folder” option is checked if you are integrating for the first time. In Xcode 7+, expand “Options” in the file picker to select “Copy items if needed” and “Create groups.”
- (Optional) If you are one of the following:
- You only want the core analytics features of the SDK and do not use any UI features (e.g, In-App Messages, News Feed, or Feedback)
- You have custom UI for Braze’s UI features and handle the image downloading yourself
You can use the core version of the SDK by removing the file
Appboy.bundle. This will remove the SDWebImage framework dependency and all the UI related resources (e.g. Nib files, images, localization files) from the SDK.
If you try to use the core version of the SDK without Braze’s UI features, in-app messages will not display. Trying to display Braze’s News Feed and Feedback UI with core version will lead to unpredictable behavior.
Step 2: Adding Required iOS Libraries
- Click on the target for your project (using the left-side navigation), and select the “Build Phases” tab
- Click the button under “Link Binary With Libraries”
- In the menu, select
- Mark this library as required using the pull-down menu next to
- Repeat to add each of the following required frameworks to your project, marking each as “required”
libz.tbdin Xcode 7+
- Add the following frameworks and mark them as optional:
- The SDWebImage framework is required for the Braze News Feed, Content Cards and In-App Messaging to function properly. SDWebImage is used for image downloading and displaying, including GIFs. If you intend to use the News Feed, Content Cards or In-App Messages, please follow the steps below.
From version 2.26.0, Braze iOS SDK only supports 4.x version of SDWebImage. If you have to use SDWebImage version 3.x, please use Braze SDK version 2.25.0 or below.
- Inside of your project folder, clone SDWebImage repository recursively:
git clone --recursive https://github.com/rs/SDWebImage.git
SDWebImage/SDWebImage.xcodeprojinto your application Xcode project.
- In your project application’s target settings, open the “General” tab, click the “+” button under the “Link Frameworks and Libraries” block and add
- In your project application’s target settings, open the “General” tab, click the “+” button under the “Embedded Binaries” block and add
- In the
SDWebImageproject settings, open the “Build Settings” tab, in the “Linking” section, locate the “Other Linker Flags” setting and add the
- In your project application’s target settings, open the “Build Settings”, in the “Search Paths” section, locate “Header Search Paths” and add
$(SRCROOT)/SDWebImagewith “recursive” turned on.
Optional Location Tracking
- Add the
CoreLocation.frameworkto enable location tracking
- You must authorize location for your users using
CLLocationManagerin your app
Step 3: Updating your App Delegate
Add the following line of code to your
1 #import "AppboyKit.h"
AppDelegate.m file, add the following snippet within your
Be sure to update
YOUR-API-KEY with the correct value from your App Settings page.
1 2 3 [Appboy startWithApiKey:@"YOUR-API-KEY" inApplication:application withLaunchOptions:launchOptions];
Be sure to initialize Braze in your application’s main thread.
AppDelegate.m file in the Stopwatch sample app.
If you do not have a bridging header file, create one and name it
your-product-module-name-Bridging-Header.h by choosing File > New > File > (iOS or OS X) > Source > Header File. Then add the following line of code to the top of your bridging header file:
1 #import "AppboyKit.h"
In your project’s Build Settings, add the relative path of your header file to the
Objective-C Bridging Header build setting under
Swift Compiler - Code Generation.
For more information about using Objective-C code in Swift projects, please refer to the Apple Developer Docs.
AppDelegate.swift, add following snippet within function
application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool:
1 Appboy.startWithApiKey("YOUR-API-KEY", inApplication:application, withLaunchOptions:launchOptions)
SDK Integration Complete
Braze should now be collecting data from your application and your basic integration should be complete. Please see the following sections in order to enable custom event tracking, push messaging, the news-feed and the complete suite of Braze features.
Full iOS class documentation is available to provide additional guidance on any of the aforementioned methods.