Step 1: Install CocoaPods
Installing the iOS SDK via CocoaPod automates the majority of the installation process for you. Before beginning this process please ensure that you are using Ruby version 2.0.0 or greater. Don’t worry, knowledge of Ruby syntax isn’t necessary to install this SDK.
Simply run the following command to get started:
1 $ sudo gem install cocoapods
Note: If you are prompted to overwrite the
rake executable please refer to the Getting Started Directions on CocoaPods.org for further details.
Note: If you have issues regarding CocoaPods, please refer to the CocoaPods Troubleshooting Guide.
Step 2: Constructing the podfile
Now that you’ve installed the CocoaPods Ruby Gem, you’re going to need to create a file in your Xcode project directory named
Add the following line to your Podfile:
1 2 3 target 'YourAppTarget' do pod 'Appboy-iOS-SDK' end
Note: We suggest you version Braze so pod updates automatically grab anything smaller than a minor version update. This looks like ‘pod ‘Appboy-iOS-SDK’ ~> Major.Minor.Build’. If you want to integrate the latest version of Braze SDK automatically even with major changes, you can use
pod 'Appboy-iOS-SDK' in your Podfile.
We recommend that integrators import our full SDK as outlined above. However, if you are certain that you are only going to integrate a particular Braze feature then you have the option to import just the desired UI subspec instead of the full SDK.
Step 3: Installing the Braze SDK
To install the Braze SDK Cocoapod, navigate to the directory of your Xcode app project within your terminal and run the following command:
1 pod install
At this point, you should be able to open the new Xcode project workspace created by CocoaPods. Make sure to use this Xcode workspace instead of your Xcode project.
Follow the instructions for Completing the Integration.
Updating the Braze SDK via CocoaPods
To update a Cocoapod, simply run the following command within your project directory:
1 pod update