Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the count of number of times the app launch iPhone

Im developing a reminder app.

So my client want to set a rate this application popup message, that'll come up on the 10th time user open the app.is this possible.

How can i implement this?

Can anyone help me please.Thanks in advance

like image 603
suji Avatar asked Dec 03 '22 06:12

suji


2 Answers

You could use NSUserDefaults for this:

    NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults];
    NSInteger appLaunchAmounts = [userDefaults integerForKey:@"LaunchAmounts"];
    if (appLaunchAmounts == 10)
    {
        [self showMessage];
    }
    [userDefaults setInteger:appLaunchAmounts+1 forKey:@"LaunchAmounts"];
like image 67
Totumus Maximus Avatar answered Dec 28 '22 22:12

Totumus Maximus


You can store that into the NSUserDefaults. Just update it in applicationDidFinishLaunching:.

like image 43
Joshua Weinberg Avatar answered Dec 28 '22 23:12

Joshua Weinberg