I have a method in my iOS app that updates the application when detects when my server has a greater version for my app (a new ipa version). If the user wants to download it, th
They will not be removed. And will have old values.
if "HasLaunchedOnce" is used in the old version. use a new one and call it "HasUpdateLaunchedOnce".
Check both values and decide what do you want to do.
if (HasLaunchedOnce exists && HasUpdateLaunchedOnce not exists)
// proceed
You could use an integer stored in NSUserDefaults with a version number hard-coded for each version of the app. If the integer is lower than the hard-coded version, prompt for updates:
NSInteger currentVersion = 3; // increment with each new version
if ([[NSUSerDefaults standardUserDefaults] integerForKey:@"HasLaunchedForVersion"] < currentVersion) {
[[NSUserDefaults standardUserDefaults] setInteger:currentVersion forKey:@"HasLaunchedForVersion"];
[[NSUserDefaults standardUserDefaults] synchronize];
// This is the first launch for this version
} else {
// App hasn't been updated since last launch
}