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)
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!
source share