Ios App Version Number Programmatically
Storeinfourl if let datainjson nsdata contentsofurl.
Ios app version number programmatically. I have an ios app with an azure back end and would like to log certain events like logins and which versions of the app users are running. In ios versions previous to 7 0 getting the mac address of device was possible. When it is accessed or requested on current version of ios it always returns 02 00 00 00 00 00.
The version that s visible to the end user it has to be incremented on each public app store release. Now will see how to detect udid name version and model programatically. Version number cfbundleshortversionstring shown as version in xcode also called the marketing version.
String versionname packageinfo version. Open xcode new project and add the below code in viewcontroller s viewdidload method. The app can then query the same server to see if it has recently received a sms message from a device with this unique app installation code.
Ios model describes whether the ios device which user is using is an iphone ipad. Using this library reading app version and build number would be as easy as this. This has been implemented by apple because of privacy concerns.
In your code you can get the app version name and code like this. Ios version is the version on which your current iphone runs latest ios version in 12 2. Get the version name and code.
String bool var upgradeavailable false get the main bundle of the app so that we can determine the app s version number let bundle nsbundle mainbundle if let infodictionary bundle infodictionary the url for this app on the itunes store uses the apple id for the this never changes so it is a constant let urlonappstore nsurl string. Import swifterswift let buildnumber swifterswift appbuild let version swifterswift appversion share. But with new ios version it has been disabled for the apps to access mac address of the device.