Get the latest version of the app in AppStore and update it

Source: Internet
Author: User

There are two ways to update a version

One is to get the latest version information from the server and compare it to the current app version

Another is to get the latest version information on AppStore and compare it to the current app version

Now let me take a look at how to get the latest version via AppStore (refer to Apple's official documentation below)

https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/

To get QQ version information as an example: You can get the QQ icon, version number and Bundleid

Open this link

http://itunes.apple.com/search?term=QQ&country=CN&entity= Ipadsoftware

Term: Represents the name of the app

Country: Representing the country

Entity: Representative type can choose to have software, Ipadsoftware, Macsoftware, don't say everybody also understand

This connection will be opened after a JS file, the content is the JSON format of the long look

Parse JSON file to get information about the app

Directly below the code

NSString *appname =@"QQ";//@ "app name"NSString *urlstr = [NSString stringWithFormat:@"Http://itunes.apple.com/search?term=%@&country=cn&entity=software", AppName]; Nsurl*url =[Nsurl Urlwithstring:urlstr]; NSData*json =[NSData Datawithcontentsofurl:url]; Nsdictionary*dict = [nsjsonserialization Jsonobjectwithdata:json options:0Error:null];//parsing JSON filesNsarray *results = [Dict objectforkey:@"Results"]; Nsdictionary*result = [Results objectatindex:0]; NSString*VERSIONSTR = [Result Objectforkey:@"version"];//get the app versionSelf.version.text =Versionstr; NSString* bundle = [result Objectforkey:@"Bundleid"];//get the App IDSelf.bundle.text = bundle;

Depending on the field: ArtworkUrl100 can also get the app icon it's not written here anymore.

Get the latest version of the app in AppStore and update it

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.