Step 1 – you need to create an application in flurry, if you don’t have an account, you have to register, if you have an account, then go to dev.flurry.com.
1. Open Applications tab and click on Add a New Application:
2. Select the platform you need – our example is created for iPhone:
3. Enter a name for your application and select the category that best fits your application:
4. Now application is created, remember your key:
Step 2 – Download the Flurry iOS SDK here. Or you may download Flurry SDK right after finishing adding Flurry app on the site.
Step 3 – Integrate Flurry SDK and other libs to the project.
Add the following frameworks to your app’s target in Xcode:
· libFlurry
· libFlurryAds
· Security.framework
· SystemConfiguration.framework
Step 4 – Add project’s code modification.
AppDelegate.h
1) add #import "Flurry.h"
AppDelegate.m
1) add to method "didFinishLaunchingWithOptions" code [Flurry setDebugLogEnabled:YES]; [Flurry startSession:@"SESSION_ID_FOR_YOUR_APP"]; // replace string with Session ID of your app [Flurry logEvent:@"logEvent: app just started"];
Step 5 – Add the code for counting how many times user clicks on the button
ViewController.h
1) add #import "Flurry.h"
ViewController.m
For counting how many times user clicks on the button
add to your event-handling method code (as an example I use method-handler “BtnClick” in my example app)
[Flurry logEvent:@"simple app button click"];
Note: Run app on real device, not on iOS Simulator.
Step 6 – Run the app and click the button in UI.
Here is an example how analytics data looks on Flurry account:
Note that information on Flurry server updates 2-3 times per day, so if the statistic info doesn’t update immediately, it’s ok, just need to wait.
Source code. Source code is available on GitHub.
We hope this manual describing how to integrate Flurry in iOS would be helpful to you.
Read also:
• How to Integrate Payment Gateway in a Mobile App?