Application Update Notification Documentation

Is there any documentation that when updating an application in Appstore a push notification is sent by the Appstore to the user about the update?

+4
source share
1 answer

You can do this using the Search API . After launching your application, check which version of the latest version of the application is in the AppStore. Like this:

- (void) checkForUpdates { NSString *jsonUrl = @"http://itunes.apple.com/search?term=yourAppName&entity=software&limit=1"; NSData *jsonData = [NSData dataWithContentsOfURL:[NSURL URLWithString:jsonUrl]]; JSONDecoder *jsonKitDecoder = [JSONDecoder decoderWithParseOptions:JKParseOptionNone]; NSObject *jsonObject = [jsonKitDecoder objectWithData:jsonData error:nil]; int results = [[jsonObject valueForKey:@"resultCount"] intValue]; if(results >0) // has results { NSArray *results = [jsonObject valueForKey:@"results"]; for(NSObject *aResult in results) { NSString *appStoreVersion = [aResult valueForKey:@"version"]; NSString *localVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; if(![appStoreVersion isEqualToString:localVersion]) { //there is an update available. Go crazy. } } } } 

I used JSONKit for this. You can use any library that you like to parse JSON extracted by Apple.

Note. You can use this to notify the user of an update WHEN he opens the application. If you want something to tell the user as soon as the update is live, you will need push notifications.

Hope this helps.

Hooray!

+9
source

All Articles