Integrate Flurry SDK for iOS¶
Flurry SDK is iOS12 compliant.
All iOS Flurry SDKs are fully compliant with ATS since version 7.2.0 released September 2015. Flurry does not require any special exceptions to be added to your apps.
For information on the working size of the Flurry iOS SDK in the App Store check out this article
Integrating with the Flurry SDK is easy and straightforward for iOS developers.
Once you get your Flurry API Key (more on how to create an app ), import Flurry libraries using CocoaPods for Swift and Objective-C Cocoa projects, add the required frameworks for Flurry integration, and finally initialize Flurry and start a Flurry session.
In no time at all, you’ll be ready to start logging events and publishing your ads.
Follow these instructions for either CocoaPods or manual integration. Swift integration steps are also provided.
Prerequisites: Xcode 8 and iOS 8 and higher.
As of Flurry SDK 8.0 the minimum support is for iOS 8. If you looking to release apps targeting devices on iOS 6 and/or iOS 7, email email@example.com and ask for Flurry SDK 7.10.0. Flurry SDK 7.10.0 it supports iOS 6 as the minimum OS version.
Create an App & 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.
You need to have the administrator role on your company’s account to be able to create a new app within the company.
For each distinct app that you create, you’ll need to acquire a unique Flurry API Key.
Import Flurry Libraries¶
Flurry recommends that you use CocoaPods to integrate the Flurry SDK, as it makes integrating and updating libraries faster, simpler and less prone to error.
If you are looking to get Flurry SDK packaged in .a files, follow the instructions for Manual SDK Integrations.
The CocoaPods integration steps are relevant if you are coding Swift or ObjectiveC.
Flurry distributes the iOS SDKs via CocoaPods. CocoaPods is used to install and manage dependencies in existing Xcode projects.
To install the CocoaPods tool on OS X, enter this command from Terminal:
$ sudo gem install cocoapods
To add a Flurry SDK to your iOS app using CocoaPods, follow these steps:
- If you are not integrating Flurry into an existing project, create an Xcode project and save it to your local machine.
- Navigate to your project’s directory and create a Podfile by typing
$ pod init.
- Open the Podfile and add your dependencies under your target. To integrate only Flurry Analytics, include only the Analytics Pod. To integrate Flurry Advertising, you must include both pods.
pod 'Flurry-iOS-SDK/FlurrySDK' #Analytics Pod pod 'Flurry-iOS-SDK/FlurryAds' #Advertising Pod (requires Analytics)
Remember to include
use_frameworks! if your app target is in Swift.
$ pod installin the directory containing the Podfile.
- Open your app’s
.xcworkspacefile to launch Xcode. Use this file for all development on your app.
For more information on working with CocoaPods, refer to the CocoaPods Getting Started guide
To finish integrating Flurry, you’ll need to import Flurry in your Application Delegate and start a Flurry session inside
applicationDidFinishLaunching, as described for Objective-C and Swift.
Addtional options for FlurrySessionBuilder:
- (FlurrySessionBuilder*) withAppVersion:(NSString *)value; - (FlurrySessionBuilder*) withSessionContinueSeconds:(NSInteger)value; - (FlurrySessionBuilder*) withCrashReporting:(BOOL)value; - (FlurrySessionBuilder*) withLogLevel:(FlurryLogLevel) value; - (FlurrySessionBuilder*) withShowErrorInLog:(BOOL) value; - (FlurrySessionBuilder*) withTVSessionReportingInterval:(NSInteger) value; - (FlurrySessionBuilder*) withTVEventCountThreshold:(NSInteger) value;
Now test run your app and ensure that it builds without errors. If everything is working properly, a session will be recorded in Flurry and should be visible on your Real Time dashboard within 30 seconds.
If you created the Flurry app within the last 5 minutes, the app may not yet be live on our servers and thus will not reflect real-time data. Re-run your app after 5 minutes to see your session recorded on the Real Time dashboard.
Starting version 6.3.0, Flurry analytics can take a delegate to callback on session getting created. A new protocol, FlurryDelegate is added to Flurry Analytics. The delegate object for Flurry needs to implement protocol, FlurryDelegate and need to be set as delegate using the following API call:
[Flurry setDelegate:<object that implements FlurryDelegate>];
Once delegate is set and the delegate responds to selector flurrySessionDidCreateWithInfo:, delegate gets callback on session getting created every time. The info provided in the callback is a NSDictionary object which contains data, “apiKey” and “sessionId”.
Congratulations! Your iOS app is now ready to be used with Flurry Analytics, and if you’ve integrated the Flurry Ads library, Flurry Advertising.
Integrating Other Analytics Features¶
Was this document helpful?