Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 1.9 KB

README.md

File metadata and controls

58 lines (37 loc) · 1.9 KB

Check Update iOS

Code to check if there is a new version on AppStore.

This code is a version based on @anupgupta-arg's code.

And is tested in a separated repository called Check Version App.

Usage

You can force the update by calling

CheckUpdate.shared.showUpdate(withConfirmation: false)

Or the user can choose if they want to update now or later by calling

CheckUpdate.shared.showUpdate(withConfirmation: true)

But, if you want to check if there is a new TestFlight version to update, you can try:

CheckUpdate.shared.showUpdate(withConfirmation: true, isTestFlight: true)

Important

Inside the code has a link from iTunes. There, you should pay attention and put the country where the application is available. Like this: http://itunes.apple.com/<country>/lookup?bundleId=\(identifier)

For example:

  • let url = URL(string: "http://itunes.apple.com/br/lookup?bundleId=\(identifier)") if the application is available in Brazil

And, in this documentation we can use:

"https://api.appstoreconnect.apple.com/v1/apps/\(identifier)/builds"

But, we need to generate a JWT Token first.

To learn how to generate an acceptable token, you should use this documentation.

Screenshots

  • If you call this line
CheckUpdate.shared.showUpdate(withConfirmation: true)

img_2968

  • Or if you call this line
CheckUpdate.shared.showUpdate(withConfirmation: false)

img_2969