iOS SDK

This document provides an overview of how to integrate, set-up and start tracking events using the iOS SDK.

***SDK Releases***

Always check the Github Release for the latest version of the SDK

The latest version of iOS SDK: v2.0.0
Integrating the Blueshift iOS SDK to your app is simple. Please follow the steps below to integrate the iOS SDK to your app.

Download CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries.

CocoaPods is distributed as a ruby gem and is installed by running the following commands in Terminal.app:

  • Shell
$ sudo gem install cocoapods
$ pod setup
  • Text

Depending on your Ruby installation, you may not have to run as sudo to install the cocoapods gem.

 

Create a Podfile

Project dependencies to be managed by CocoaPods are specified in a file called Podfile. Create this file in the same directory as your Xcode project (.xcodeproj) file:

  • Shell
$ touch Podfile
$ open -a Xcode Podfile

You just created the pod file and opened it using Xcode!

Copy and paste the following lines into the Xcode window:

  • Shell
target 'APP NAME TARGET' do
  pod 'BlueShift-iOS-SDK'
end

If you are integrating attachment media type push notification with Notification Service Extension (for iOS 10 and above), add the following lines:

  • Shell
target 'APP EXTENSION TARGET NAME' do
  pod 'BlueShift-iOS-Extension-SDK'
end

If you are using Swift, create bridge-header for your app and import the following header:

  • Objective-C
#import <BlueShift-iOS-SDK/BlueShift.h> 

 

Install Dependencies

Now you can install the dependencies in your project by Terminal:

  • Shell
$ pod install

From now on, be sure to always open the generated Xcode workspace, (.xcworkspace) instead of the project file when building your project (.xcodeproj):

  • Shell
$ open <ProjectName>.xcworkspace

Was this article helpful?
0 out of 0 found this helpful