Correct appDelegate method to run Flurry?

Flurry docs recommends placing the startSession call in applicationDidFinishLaunching:

Two problems with this ...

 - (void)applicationDidFinishLaunching:(UIApplication *)application { [FlurryAnalytics startSession:@"AWESOMEAPIKEY"]; // ... } 

1) Isn't application:didFinishLaunchingWithOptions: new approved launch point?

2) This is called only once at startup, but do we not want to receive session information every time a user opens or switches back to the application? Or does Flurry handle it all on its own, listening to some kind of event or NSNotification ?


Isn't it better to place the startSession call in applicationDidBecomeActive: or applicationWillEnterForeground: for example?

 - (void)applicationDidEnterBackground:(UIApplication *)application { // ... Flurry AppCircle setup [FlurryAnalytics startSession:@"AWESOMEAPIKEY"]; // ... your setup } 
+6
source share
2 answers

for your business 1) the right place to post [FlurryAnalytics startSession:@"SOMESESSIONKEY"]; -

 application:didFinishLaunchingWithOptions: 

You can place it there without worries. I did it myself, and the application works amazingly in the appstore and provides great statistics.

for case 2), your unit will automatically resume when the application returns to the forefront, so you do not need to perform any special processing.

+2
source

I was also curious. I looked at my inherited code for my application and did not see any bursts of activity in didbecomeactive, in the foreground, etc. I just saw the beginning in dofinishlaunchingwithoptions. I saw below on the flurry re: startession website, but I still don’t understand how it works, just behind the scenes, what does the flurry library do? @samfisher, can you clarify?

"This method serves as an entry point into the Flurry Analytics collection and should be called in the applicationDidFinishLaunching area. The session will continue for as long as the application is in the foreground until your application is re-specified for the time specified in setSessionContinueSeconds: If the application is resumed during this period, the session will continue, otherwise a new session will begin. "

FlurryApi.h shows the default value as 10 for setSessionContinueSeconds, so I think Flurry is handling it, I'm just looking for confirmation.

http://support.flurry.com/sdkdocs/iOS/interface_flurry_analytics.html#a78b0b92085b38875d51f1ca0d699849a

+1
source

Source: https://habr.com/ru/post/903925/


All Articles