Created
July 30, 2015 19:43
-
-
Save kohiomobz/c37af4f8fdfe65e857c6 to your computer and use it in GitHub Desktop.
First App Launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let’s check if we have a firstLaunch property inside NS Standard Defaults - if not, let’s set first app launch to YES | |
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]){ | |
NSDictionary *appLaunchProperties = @{@"first app launch" : @YES}; | |
[[Mixpanel sharedInstance] track:@"App Launched" properties:appLaunchProperties]; | |
[[Mixpanel sharedInstance] registerSuperProperties:appLaunchProperties]; | |
[[Mixpanel sharedInstance].people set:@{@"First App Launch": [NSDate date]}]; | |
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstLaunch"]; | |
[[NSUserDefaults standardUserDefaults] synchronize]; | |
} else { | |
// Otherwise set first app launch to NO | |
[[Mixpanel sharedInstance] registerSuperProperties:@{@"first app launch" : @NO}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment