Publisher/GettingStarted/UpgradeTo4
Quick Links
Configuring AppCircle & Rewards
Setting up Advertisers & Creatives
1. Introduction
The 4.x Flurry iOS SDK is modularized to allow our partners to select exactly the components they wish to integrate into their app. This will allow for more targeted updates and smaller distributions for partners that only integrate a subset of available Flurry services.
The Flurry iOS Analytics library is required for any integration. You may optionally add on the Flurry Ads library. Here is a brief description of those libraries:
- Flurry Analytics Agent allows you to track the usage and behavior of your iPhone application on users' phones for viewing in the Flurry Developer Portal.
- Flurry Ads Agent allows you to earn revenue by offering App, Video, and Reengagement recommendations in your app. Supported integrations include banners, takeovers, and offerwalls.
2. Upgrading
Upgrading to 4.x is a straightforward process that should take less than 10 minutes.
Flurry Analytics
- FlurryAPI (2.x) or FlurryAnalytics (3.x) is now just Flurry. Replace FlurryAPI/FlurryAnalytics in existing calls that relate to capturing analytics data with Flurry.
- In the finder, drag Flurry/ into project's file folder. (NOTE: Be sure to remove any existing Flurry library folders from your project's file folder before proceeding. Older versions were under FlurryLib or FlurryAnalytics)
- Now add it to your project: Project > Add to project > Flurry
- Choose 'Recursively create groups for any added folders'
- In your Application Delegate:
- Import Flurry and inside "applicationDidFinishLaunching:" add: [Flurry startSession:@"YOUR_API_KEY"];
#import "Flurry.h"
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[Flurry startSession:@"YOUR_API_KEY"];
//your code
}
#import "Flurry.h" - (void)applicationDidFinishLaunching:(UIApplication *)application { [Flurry startSession:@"YOUR_API_KEY"]; //your code }
Flurry Ads
Important: Do not reuse Ad Space names from 3.x integrations in 4.x integrations.
- Make sure to first follow steps for Flurry Analytics integration above. The Ads library is dependent on the Analytics library. Replace FlurryAPI or FlurryAppCircle/FlurryClips/FlurryReengagement in existing calls that relate to app recommendations with FlurryAds.
- In the finder, drag FlurryAds/ into project's file folder.
- Now add it to your project: Project > Add to project > FlurryAds
- Choose 'Recursively create groups for any added folders'
- In your Application Delegate:
- In your source code, import FlurryAds and initialize it after calling Analytics’ startSession selector:
#import "Flurry.h"
#import "FlurryAds.h"
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[Flurry startSession:@"YOUR_API_KEY"];
[FlurryAds initialize:rootViewController];
//your code
}
#import "Flurry.h" #import "FlurryAds.h" - (void)applicationDidFinishLaunching:(UIApplication *)application { [Flurry startSession:@"YOUR_API_KEY"]; [FlurryAds initialize:rootViewController]; //your code }
Sample 3.x Integration of Analytics and Ads
#import "FlurryAnalytics.h" #import "FlurryAppCircle.h" #import "FlurryClips.h" #import "FlurryReengage.h" -(void)applicationDidFinishLaunching: (UIApplication *)application { [FlurryAppCircle setAppCircleEnabled:YES]; [FlurryClips setVideoEnabled:YES]; [FlurryReengage setReengageEnabled:YES]; [FlurryAnalytics startSession:@"YOUR_API_KEY"]; // Your code } -(void)showAd { // Check if ad inventory is available // per hook. BOOL adAvailable = [FlurryAppCircle appAdIsAvailable:@"APP_REC"]; BOOL videoAvailable = [FlurryClips videoAdIsAvailable:@"VIDEO_REC"]; BOOL adAvailableR = [FlurryReengage appAdIsAvailable:@"APP_REENGAGE"]; // Build IF statement based on ad // inventory to determine which ad // formats to display if (adAvailableR) { [FlurryReengage openTakeover:@"APP_REENGAGE" orientation:@"landscape" rewardImage:nil rewardMessage:nil userCookies:nil]; } else if (videoAvailable) { [FlurryClips openVideoTakeover:@"VIDEO_REC" orientation:nil rewardImage:nil rewardMessage:nil userCookies:nil autoPlay:NO]; } else if (adAvailable) { [FlurryAppCircle openTakeover:@"APP_REC" orientation:@"landscape" rewardImage:nil rewardMessage:nil userCookies:nil]; } else { // Perform some other action } }
Equivalent 4.x Integration of Analytics and Ads
#import "Flurry.h" #import "FlurryAds.h" -(void)applicationDidFinishLaunching: (UIApplication *)application { [Flurry startSession:@"YOUR_API_KEY"]; [FlurryAds initialize:rootViewController]; // Your code } -(void)showAd { if ([FlurryAds adReadyForSpace: @"INTERSTITIAL_MAIN_VIEW"]) { [FlurryAds displayAdForSpace: @"INTERSTITIAL_MAIN_VIEW" onView:self.view]; } else { // Fetch an ad (note: optimize ad // serving by fetching early) [FlurryAds fetchAdForSpace: @"INTERSTITIAL_MAIN_VIEW" frame:self.view.frame size:FULLSCREEN]; } }
Please let us know if you have any questions. If you need any help, just email support@flurry.com!
