How iOS updates apps

Source: Internet
Author: User

How iOS updates apps

App update process

Obtain the current version number currentVersion. Compare currentVersion with the latest version number latestVersion. If the current currentVersion number is small, update the current version number.

 

Obtain the current app version:

 

NSString * currentVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey: @ cfbundle#versionstring];

There are two situations:

1. Update the App submitted to the AppStore (Force update is not supported)

Use the following link to initiate a post request to obtain the details of the latest version of the AppStore (app author, connection, version, etc ).

Http://itunes.apple.com/lookup? Id = Application ID (the Application ID is generated when the application is published on apple)

The returned data is in JSon format. For the data format, refer to the Lookup Examples

Http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html

Parse the returned JSon data through http://www.bejson.com/jsonviewernew/website

It is resolved as an NSDictionary, and the value corresponding to the version is the latest version number (then you know how to do it !!!)

If you want to update the application after the comparison, you can open the link of the application in the AppStore in the following way, and the user can update it!

 

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: appUrlString];

What is appUrlString? In the NSDictionary just parsed, the corresponding key is trackViewUrl.

 

2. Update enterprise apps (Force update supported)

This update is relatively random, because everything is written on the background. I am the master of my website. Here we can force update.

There are two main interfaces: The Update Check interface and the update interface.

The steps are the same as updating the App submitted to the AppStore, except that the interface is written by yourself...

 

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.