Flurry App Analytics for iOS¶
Gain deep insight into your customer’s behavior very quickly and with little effort using Flurry Analytics for iOS. The integration process is designed to be as easy as possible with basic setup that you can complete in a short period of time.
1. Get your API Keys¶
Start by creating an app. Once you create the app, you’ll receive a Flurry API Key, which you’ll need when using the SDK.Sign up or Create an App for iPhone
2. Integrate the SDK With Your App¶
Minimum supported version is iOS6
If you are using Xcode 7, you can use the latest version of the Flurry SDK (7.1.1). Otherwise, please use the SDK 7.1.0. You can acquire Flurry SDK 7.1.0 from the Cocoapods following the instructions provided below. For direct integration the library files are available from https://github.com/flurry/Flurry-iOS-SDK/tree/7.1.0
Framework and library providers need to include bitcode for Xcode 7 development, and Xcode 7 generates bitcode by default. To build a library without bitcode, either use Xcode 7 with the build setting Enable Bitcode disabled (ENABLE_BITCODE=NO) or use Xcode 6.
There are two distinct ways to acquire the Flurry SDK and to add it into your app. To get the Flurry SDK into your app, use Option 1 or Option 2 :
Option 1: Download the SDK Files and manually add them to your Xcode project
Download the SDK for your iOS project. The downloaded SDK includes the required library containing Flurry’s collection and reporting code.
In the Finder, drag the Flurry SDK into your project’s file folder. (Note: If you are upgrading the Flurry iOS SDK, be sure to remove any existing Flurry library folders from your project’s file folder before proceeding.)
Now add it to your project: File > Add Files to “YOUR PROJECT”
Add SystemConfiguration.framework to your app. This is required for Reachability to manage network operations efficiently.
For iOS SDK 4.2.3+, add Security.framework to your app.
Option 2: Acquire the Flurry SDK using CocoaPods
Flurry distributes the iOS SDKs via CocoaPods. CocoaPods is used to install and manage dependencies in existing Xcode projects.
You can install the CocoaPods tool on OS X by running the following command from the terminal:
$ sudo gem install cocoapods
Detailed information is available in the CocoaPods Getting Started guide
To add a Flurry SDK to your iOS app:
Create an Xcode project, and save it to your local machine.
Create a file named Podfile in your project directory. This file defines your project’s dependencies, and is commonly referred to as a Podspec.
Open Podfile, and add your dependencies. A simple Podspec shown here provides the latest SDK:
target 'yourTargetName' do # uncomment next line if you're using Swift # use_frameworks! pod 'Flurry-iOS-SDK/FlurrySDK' # uncomment next line if you also want to use ad publishing # pod 'Flurry-iOS-SDK/FlurryAds' end
To acquire an earlier version of the Flurry SDK provide the version desired, for instance:
target 'yourTargetName' do # uncomment next line if you're using Swift # use_frameworks! pod 'Flurry-iOS-SDK/FlurrySDK', '~> 7.1.0' # uncomment next line if you also want to use ad publishing # pod 'Flurry-iOS-SDK/FlurryAds', '~> 7.1.0' end
Save the file.
Open a terminal and cd to the directory containing the Podfile:
$ cd <path-to-project>/project/
Run the pod install command. This will install the SDKs specified in the Podspec, along with any dependencies they may have.:
$ pod install
Open your app’s .xcworkspace file to launch Xcode. Use this file for all development on your app.
3. Integrate Flurry Analytics¶
If you are using Swift, check out our Flurry Swift Integration guide
In your Application delegate, import Flurry and inside
Flurry recommends calling Flurry Analytics from the main thread. Flurry Analytics is not supported when called from other threads.
The Flurry SDK automatically transfers the data captured during the session once the SDK determines the session completed. In case the device is not connected, the data is saved on the device and transferred once the device is connected again. The SDK manages the entire process. Currently, there is no way for the app to schedule the data transfer.
A unique API Key must be used for each distinct app. Using the same API Key across distinct apps is not supported and will result in erroneous data being displayed in Flurry Analytics.
The validity of the Crash Analytics data will be negatively affected by the use of an uncaught exception handler. Please remove all such handlers when using Flurry Crash Analytics.
Following these steps provides you with access to the wide range of features listed below. In the Lexicon section of the documentation, you’ll find detailed descriptions of these features and terms.
Frequency of Use
Custom User Segments
iOS Category Interests
Time of Day Reporting
Now that you’ve completed the basic setup, you are ready to move on to custom events, which enable you to better understand user behavior through Tracking Custom Events.
We’d love to hear your suggestions for us. Please visit our feedback board to submit your ideas.