Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to detect first time app launch after update from app store ,iphone

I need to do something only after when the application update from appstore. I do it with NSUserDefaults but it's not good for me because it works only after the first update.

help

thanks

like image 412
Guy Kahlon Avatar asked Jan 14 '23 14:01

Guy Kahlon


2 Answers

The MTMigration project (MIT license) does exactly what you want:

Manages blocks of code that only need to run once on version updates in iOS apps. This could be anything from data normalization routines, "What's New In This Version" screens, or bug fixes.

An example of its use:

[MTMigration migrateToVersion:@"0.9" block:^{
    // Some 0.9 stuff
}];

[MTMigration migrateToVersion:@"1.0" block:^{
    // Some 1.0 stuff
}];
like image 99
Mike Weller Avatar answered Jan 16 '23 02:01

Mike Weller


if ([[NSString stringWithFormat:@"Version %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]isEqualToString:@"Version 1.0"])
{
// run your code here
}
like image 37
KennyVB Avatar answered Jan 16 '23 03:01

KennyVB