Force user to update the app programmatically in iOS

23,253

Solution 1

Point 2 : You should only allow force update as an option if you don't want user to update later. Closing the app programmatically is not the right option.

Point 1 : You can use a good library available for this purpose.

Usage in Swift: Library

func applicationDidBecomeActive(application: UIApplication) {
    /* Perform daily (.daily) or weekly (.weekly) checks for new version of your app.
    Useful if user returns to your app from the background after extended period of time.
     Place in applicationDidBecomeActive(_:)*/

    Siren.shared.checkVersion(checkType: .daily)
}

Usage in Objective-C: Library

-(void)applicationDidBecomeActive:(UIApplication *)application {
    // Perform daily check for new version of your app
    [[Harpy sharedInstance] checkVersionDaily];
}

How it works : It used lookup api which returns app details like link including version and compares it.

For an example, look up Yelp Software application by iTunes ID by calling https://itunes.apple.com/lookup?id=284910350

For more info, please visit link

Solution 2

Don't close the app programmatically. Apple can reject the app. Better approach will be do not allow user to use the app. Keep the update button. Either user will go to app store or close the app by himself.

According to Apple, your app should not terminate on its own. Since the user did not hit the Home button, any return to the Home screen gives the user the impression that your app crashed. This is confusing, non-standard behavior and should be avoided.

Please check this forum:

https://forums.developer.apple.com/thread/52767.

It is happening with lot of people. In my project I redirected the user to our website page of downloading app from app store. In that way if the user is not getting update button in app store, at least the user can use the website in safari for the time being.

Solution 3

To specifically answer your question:

  1. Use this URL to directly open to your app in the app store: https://apps.apple.com/app/id########## where ########## is your app's 10 digit numeric ID. You can find that ID in App Store Connect under the App Information section. It's called "Apple ID".
  2. I actually have terminate functionality built into my app if it becomes so out of date that it can no longer act on the data it receives from the server (my app is an information app that requires connectivity to my web service). My app has not been rejected for having this functionality after a dozen updates over a couple years, although that function has never been invoked. I will be switching to a static message instead of terminating the app, just to be safe to avoid future updates from being rejected.

I have found that the review process is at least somewhat subjective, and different reviewers may focus on different things and reject over something that has previously been overlooked many times.

Share:
23,253

Related videos on Youtube

user1960169
Author by

user1960169

Updated on August 16, 2021

Comments

  • user1960169
    user1960169 over 2 years

    In my iOS app I have enabled force app update feature. It is like this.

    If there is a critical bug fix. In the server we are setting the new release version. And in splash screen I am checking the current app version and if its lower than the service version, shows a message to update the app.

    I have put 2 buttons "Update now", "Update later"

    I have 2 questions

    1. If I click now. App should open my app in the appstore with the button UPDATE. Currently I use the link "http://appstore.com/mycompanynamepvtltd" This opens list of my company apps but it has the button OPEN, not the UPDATE even there is a new update for my app. whats the url to go for update page?

    2. If he click the button "Update Later" is it ok to close the app programmatically? Does this cause to reject my app in the appstore?

    Please help me for these 2 questions

    • Paulw11
      Paulw11 over 6 years
      In my opinion a button that closes the app isn't really a "later". I would expect the app to keep operating if I click "later"
    • Amit
      Amit
      Please check this forum: forums.developer.apple.com/thread/52767 . It is happening with lot of people. In my project I redirected the user to our website page of downloading app from app store. In that way if the user is not getting update button in app store, at least the user can use the website in safari for the time being.
  • user1960169
    user1960169 over 6 years
    how does this check my app version and redirect user to update it?
  • thomers
    thomers about 5 years
    Note: This is a paid service.

Related