Reputation: 53
I'm currently building a Swift based iOS application.
In my application, I'd like to validate specific security features of the device.
One of these is to ensure that the device has the latest iOS version installed.
Of course, getting the currently installed version of iOS on the device is quite simple. But I can't seem to find any API to programmatically determine what the latest available iOS version is.
Is there some API to do this? Or perhaps some REST API I can call on an Apple site to glean this information?
Upvotes: 5
Views: 3250
Reputation: 1522
Apple provides an API at curl http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.appserver.client.MZITunesClientCheck/version
. Test it on the command line using:
curl http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.appserver.client.MZITunesClientCheck/version
The response is XML, and the information you need is keyed by device version (eg iPhone8,1
).
You can access your device's version by using sysctlbyname()
from Swift.
Update Looks like the old URL (http://phobos.apple.com./version
) died a while back (thanks Troy) so have updated my answer with another version. I have no idea if the content is the same.
Upvotes: 8