Always thought that AppStore has the mechanism to check whether the version is updated, we do this update function in the app will be rejected, but also see some of the app has also done this update function. Because the internet did not find the exact method to get the data in itunes, so write this article to the needs of the development of small partners.
Here I have integrated the two methods of online said to check the update:
The first: Get the app version number of your own server compared to the installed app version number
This is the need for the server to do the operation, because my side of the client has been done, backstage and very busy, I did not go to find the server how to get, I think it should be and app almost to request itunes data, but our app through the interface to call, get to the version number we need.
Second: Compared to the version number of the app that has been published to AppStore and the version number of the installed app is updated
1. Get the current app version number
Of course, get the name of the current app or a compiled version is possible, directly replace the red font, get the name: Cfbundledisplayname, get the compiled version: Cfbundleversion;
2. Get the version of the app on itunes
At first I was using the Internet to find the string of URLs to call, post the request:http://itunes.apple.com/lookup?id= your Application ID, This ID is like Bundleid is unique, But then I found that I was going for a failed callback. Later found a share said is because it is the domestic app, get not data, to the above the string URL of the. com after adding/cn, so I also did, found that the failure of the callback, so I carefully examined the ID of my application again, The ID is in your itunes app information, such as:
Check out or exactly the same, and then think of a lot of web pages are encrypted, maybe it should be with HTTPS, so the HTTP request to HTTPS, and then print out a lot of data, all of itunes you submit information, It certainly includes the latest version number on your app's line. The code is as follows:
The itunesversion in the code is to get the version number of the online app. You can use breakpoints to print out all the data to see what you can use.
iOS quick integration Check for updates