Is there any documentation saying that when the application on Appstore is updated a push notification is send by Appstore itself to user about the update ?
You can do that with Search API. In your app , after launching , check to see what is the latest version of your app on 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 the JSON retrieved by Apple.
Note: You can use this to notify the user that there is an update WHEN he opens the app. If you want something that tells the user as soon as the update is live , you need push notifications.
Hope this helps.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With