iOS app update notification

22,241

Solution 1

You can use Harpy : this module trigger a UIAlertView when a new version of your app is available on the App Store.

Harpy is now depricated.Siren was ported from Harpy, as Siren and Harpy are maintained by the same developer. As of December 2018, Harpy has been deprecated in favor of Siren.

Solution 2

  1. Apple provides an existing API to get the latest app information from your app on the App Store: http://itunes.apple.com/jp/lookup/?id=app_id

Ex: http://itunes.apple.com/jp/lookup/?id=1005582646

Ex for a US app: http://itunes.apple.com/lookup/?id=myAppIDNumberFromTheAppStore

Note that this is separate from the App Store Connect API. If you use that, you'll need to generate a token before making the request. Please review the documentation on the API first or you will get a response with empty results.

https://developer.apple.com/documentation/appstoreconnectapi

https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests

The response of the iTunes API has a "version" field that is within the "results" field. It has the version number of the latest build on the App Store.

In AppDelegate->didFinishLaunchingWithOptions, you can call the above API.

  1. The way to get current version on user's device:

Obj-C.

NSString *currentAppVersion = [[[NSBundle mainBundle]
    infoDictionary] objectForKey:@"CFBundleShortVersionString"];

Swift (4.2)

var currentAppVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String

Now you can compare the version number from 1 and 2 to show an alert or notification to the user when there is an updated app on the App Store.

Share:
22,241
Prerna chavan
Author by

Prerna chavan

Updated on August 13, 2020

Comments

  • Prerna chavan
    Prerna chavan almost 4 years

    How does the iOS app update mechanism work? How to tell user that application on Appstore has been updated?Do i have to write the functionality in the code to show the update popover or is it handled by Appstore to show notification to user that app has been updated. Is there any documentation provided by apple for this?

  • MartinMoizard
    MartinMoizard almost 11 years
    I used it in one app, I'm happy with it
  • Ganesh G
    Ganesh G over 9 years
    How to test Harpy before submitting the app into Apple Store?
  • ArtSabintsev
    ArtSabintsev about 9 years
    @G.Ganesh Change the version of your app in Xcode to a version that's less than the one in the App Store. If version 1.0.2 is in the App Store, then change the version of your app to 1.0.1 and build+run your app. If you see an alert, it works. You can now change the version back to whatever it is before you launch your app to the store.
  • kareem
    kareem almost 8 years
    Use Siren for swift implementation of Harpy. Same developer.
  • sasi kumar
    sasi kumar over 6 years
    How to test this?
  • Ammaiappan
    Ammaiappan almost 6 years
    Please share the link for all appstore api