iOS Application Update Test -
is there method though wants test when application updated?
i embarrassed because there bug occurs when application updated, , doesn't investigate.
if asking if want find when application updated through app store, not aware of such method.
a hackie approach save current app version nsuserdefaults, check if nsuserdefaults app version equal 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 same app version } else { //the app version changed last launch } } else { //first run, set key & synchronize [[nsuserdefaults standarduserdefaults] setobject:currentappversion forkey:@"savedappversionkey"]; [[nsuserdefaults standarduserdefaults] synchronize] } }
i haven't tested code, should work.
thanks,
-david
Comments
Post a Comment