Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if app automatically updated in iOS 7

Tags:

ios

ios7

I want to be able to display an alert describing what's new when an app has been updated. What's the best way to do this, especially considering iOS 7 automatically updates apps? Thanks!

like image 740
tanya Avatar asked Mar 21 '23 15:03

tanya


2 Answers

You can store the app version in NSUserDefaults. Then if the old app version != current app version you can display your dialog

Version #:

NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"];

Set:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:version forKey:@"appVersion"];

Get:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults objectForKey:@"appVersion"];
like image 109
mergesort Avatar answered Apr 02 '23 09:04

mergesort


When the user starts your app, check a version string in user defaults or a file or database.

If you want to do it around the time the app is updated, you might be able to use push notifications in conjunction with the version check. I don't know whether you can get the new app to check the version in the background, though (never used push notifications myself).

like image 30
Marcelo Cantos Avatar answered Apr 02 '23 07:04

Marcelo Cantos