After the project is on-line generally involves upgrading, then iOS how to get the version number from AppStore
Actually, it's simple.
NSString *url = [[NSString alloc] initwithformat:@ "http://itunes.apple.com/lookup?id=%@", @ "987953868"];
The last number in the list is the unique ID of the current app. How to get this ID, Baidu a bit simple
Then we just need to call this address and we'll return some information about the current app, including the version number on AppStore (provided the project is online to AppStore)
We're going to get the process done and we'll just call the address directly using this method.
Get AppStore version number nsstring *url = [[NSString alloc] initwithformat:@ "http://itunes.apple.com/lookup?id=%@", @ " 987953868 "]; [Self postpath:url];
#pragma mark--Get data-(void) Postpath: (NSString *) path{nsurl *url = [Nsurl Urlwithstring:path]; Nsmutableurlrequest *request = [Nsmutableurlrequest requestwithurl:url Cachepolicy:nsurlrequestreloadignoringcachedata Timeoutinterv AL:10]; [Request sethttpmethod:@ "POST"]; Nsoperationqueue *queue = [Nsoperationqueue new]; [Nsurlconnection sendasynchronousrequest:request queue:queue completionhandler:^ (NSURLResponse *response,NSData * Data,nserror *error) {nsmutabledictionary *receivestatusdic=[[nsmutabledictionary alloc]init]; if (data) {nsdictionary *receivedic = [Nsjsonserialization jsonobjectwithdata:data Options:nsjsonr Eadingmutableleaves Error:nil]; if ([[Receivedic valueforkey:@ "Resultcount"] intvalue]>0) {[Receivestatusdic setvalue:@ "1" forkey:@ "status"]; [Receivestatusdic setvalue:[[[receivedic valueforkey:@ "results"] objectatindex:0] valueforkey:@ "version"] fo rkey:@ "Version"]; }else{[Receivestatusdic setvalue:@ "-1" forkey:@ "status"]; }}else{[Receivestatusdic setvalue:@ "-1" forkey:@ "status"]; } [Self Performselectoronmainthread: @selector (receivedata:) withobject:receivestatusdic Waituntildone:no]; }];}
-(void) Receivedata: (ID) sender{ NSLog (@ "receivedata=%@", sender); }
The final printed dictionary contains the version number
receivedata={
status = 1;
Version = "1.0.0";
}
Okay, what's the problem? Welcome Dabigatran Discussion
Apple Development Group: 414319235 Welcome to join the Welcome discussion question
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
IOS Get AppStore version number