The Apptentive iOS SDK is available via CocoaPods, a third-party dependency manager for developers on Apple platforms.
You need to create a file called “Podfile” that controls the dependencies that CocoaPods installs in your Xcode project:
- If you don’t already have a Podfile for your project, run
pod initin your project folder.
- Find the latest
apptentive-iospod information on the CocoaPods site.
- Add the Apptentive dependency to your Podfile. It should look something like this:
platform :ios, '9.0' use_frameworks! target '<Your App Target Name>' do pod 'apptentive-ios', '~> 5.0' end
post_install do |pi| pi.pods_project.targets.each do |target| target.build_configurations.each do |config| unless pi.podfile.defined_in_file.read().include? "\nuse_frameworks!\n" config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)'] config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'NO_USE_FRAMEWORKS=1' end end end end
You will also have to add NO_USE_FRAMEWORKS=1 to the Preprocessor Macros section of your target’s build settings.
Install the Apptentive Pod
When the Apptentive dependency has been listed in your Podfile, run the Terminal command
pod install in your Xcode project directory:
$ pod install
If you haven’t previously used CocoaPods for your project, this will create an Xcode Workspace containing your original project plus a project containing the Apptentive SDK (any additional CocoaPods you add in the future will be added to this second project). You will need to open this workspace (instead of your project) to make use of the CocoaPods that you have installed.