Is there a method though it wants to test when the application is updated?
I am embarrassed because there is a bug that occurs only when the application is updated, and it doesn't investigate.
If you are asking if you want to find when the application is updated through app store, I am not aware of such a method.
A hackie approach to do this is to save the current app version to NSUserDefaults, then check if the NSUserDefaults app version is equal to the current app version.
For example:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSString *currentAppVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
if ([defaults objectForKey:@"savedAppVersionKey"] != nil) {
//key exists
NSString *savedAppVersion = [[NSUserDefaults standardUserDefaults] objectForKey:@"savedAppVersionKey"];
if ([currentAppVersion isEqualToString:savedAppVersion]) {
//still running the same app version
}
else {
//the app version changed from the last launch
}
}
else {
//first run, set the key & synchronize
[[NSUserDefaults standardUserDefaults] setObject:currentAppVersion forKey:@"savedAppVersionKey"];
[[NSUserDefaults standardUserDefaults] synchronize]
}
}
I haven't tested the code, but it should work.
Thanks,
-David
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With