How to alert your app users update to the latest version?

App Store doesn't allow app have features about update version. Sometimes you need your app users run the latest version, but some users don't update to the latest version from the App Store. So you should check the latest version and alert your users update it, when the user launching the old version app.

February 15, 2017 -
app user

       If your Apple Developer Membership is Apple Developer Enterprise Program, you can’t sell apps on the App Store, but you can control your users app run which version on which device.
      If your Apple membership is Apple Developer Program, your apps sell on the App Store. App Store doesn’t allow app have features about update version. Sometimes you need your app users run the latest version, but some users don’t update to the latest version from the App Store. So you should check the latest version and alert your users update it, when the user launching the old version app.
      Apple has an open lookup api, https://itunes.apple.com/lookup?id=appID, the only parameter is your app ID. you can use you app ID to request some information, it include version info. The app on App Store is always the latest version.
      When user launching app on iPhone/iPad, you can lookup your app version info on App Store.

Attention:

  1. if the app launching time more than 20s, iOS will cancel it. The lookup will take slow the launching time, sometimes very slow.
  2. The lookup have to run on the main thread, and lock it, you can use this code segment:
- (void)runOnMainQueueWithoutDeadlocking:(void (^)())block {
    if ([NSThread isMainThread]) {
        block();
    } else {
        dispatch_sync(dispatch_get_main_queue(), block);
    }
}

Now you have the user running app’s version info, and the app version info on App Store. So you can comparison the two versions, if they are different, you should alert user update to the latest version on App Store.

I write a framework MJWUpdate to do this, if you want to use it, you can read the README and run the example MJWUpdateExample. The source code is public on GitHub.