Skip to content

Instantly share code, notes, and snippets.

@jmbeck
Created May 21, 2014 15:25
Show Gist options
  • Save jmbeck/babb1b6446fe0e0872ab to your computer and use it in GitHub Desktop.
Save jmbeck/babb1b6446fe0e0872ab to your computer and use it in GitHub Desktop.
Kochava Slow Startup on Main Thread
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
CLS_LOG(@"launchOptions: %@", launchOptions);
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"kothredupios3903535ae2e402049", @"kochavaAppId",
// @"1", @"enableLogging",
@"1", @"retrieveAttribution",
nil];
NSLog(@"*** Begin init ***");
kochavaTracker = [[KochavaTracker alloc] initKochavaWithParams:params];
NSLog(@"*** End init ***");
// ... didFinishLaunching continues
}
/* Logs
2014-05-21 08:20:08.501 iOS-Boutique[3103:60b] *** Begin init ***
2014-05-21 08:20:09.142 iOS-Boutique[3103:60b] *** End init ***
*/
@mattsellars
Copy link

I've also noticed this and it seems that the library is doing IO on the main thread which sometimes causes the app to freeze for a moment on startup :/

Trying to move this init call on a background thread crashes the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment