Reputation: 12499
This would be a common scenario: an app that requests username and password to access its functionalities. Users would likely had already logged in the app at the time an app update comes from App Store and they download and install it. What should the best approach be here: to keep the user logged in, or to force her to log in again?
If it is more common to show the user the welcome view and make her log in again after an update (I think that, for example, Twitter does like this), how could I do that? I've a flag in NSUserDefaults
I check to know if the user has logged in or not. It seems that NSUserDefaults
values are kept after updates. How could I know that an update has been installed?
Upvotes: 1
Views: 275
Reputation: 16543
You can get the current version of the app.
NSString *appversion = [NSString stringWithFormat:@"Version %@ (%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"], kRevisionNumber];
So store the app version and check when there is a change in appversion then your app is updated.
Upvotes: 1