Skip to content

Instantly share code, notes, and snippets.

@SergLam
Created November 20, 2019 08:15
Show Gist options
  • Save SergLam/80d0ba65c457e11cd2a97131d1d738d5 to your computer and use it in GitHub Desktop.
Save SergLam/80d0ba65c457e11cd2a97131d1d738d5 to your computer and use it in GitHub Desktop.
Check iOS app version info via App Store request
// Perform URL request
// http://itunes.apple.com/lookup?bundleId=YOUR_APP_BUNDLE_ID
// TXT-file with JSON data will be downloaded
// Parse it, fetch version key-value
// "version":"1.5"
// Compare it with your current app version
let appVersion = Bundle.main.infoDictionary["CFBundleShortVersionString"] as? String
let buildNumber = Bundle.main.infoDictionary["CFBundleVersion"] as? String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment