How to alert user of new update of iOS app
Don't worry there is no code required. I've recently updated my app and I was wondering the same thing. It should do it automatically once the new version is on the store. A small red icon will appear in the top right of the App Store app icon. ;)
Alert when new version of iOS app is available
iVersion sounds like the exact thing you are looking for. It works similar to Sparkle on Mac OSX where it consults a remote file on your website where you can bump the version number once Apple approves your app and shows a prompt to the user if their version is lower than the one specified on your server.
Is it possible to send update notification to app users iOS
Code for App Version Comparision is:
func checkAppUpdateAvailability(onSuccess: @escaping (Bool) -> Void, onError: @escaping (Bool) -> Void) {
guard let info = Bundle.main.infoDictionary,
let curentVersion = info["CFBundleShortVersionString"] as? String,
let url = URL(string: "http://itunes.apple.com/lookup?bundleId=com.facebook.app") else {
return onError(true)
}
do {
let data = try Data(contentsOf: url)
guard let json = try JSONSerialization.jsonObject(with: data, options: [.allowFragments]) as? [String: Any] else {
return onError(true)
}
if let result = (json["results"] as? [Any])?.first as? [String: Any], let appStoreVersion = result["version"] as? String {
print("version in app store", appStoreVersion," current Version ",curentVersion);
let versionCompare = curentVersion.compare(appStoreVersion, options: .numeric)
if versionCompare == .orderedSame {
onSuccess(false)
} else if versionCompare == .orderedAscending {
onSuccess(true)
// 2.0.0 to 3.0.0 is ascending order, so ask user to update
}
}
} catch {
onError(true)
}
}
Now you can check App Update.
checkAppUpdateAvailability { (status) in
//When status == true show popup.
} onError: { (status) in
// Handle error
}
Related Topics
How to Create a PDF File Programmatically in an iOS Application
How to Parse Array of JSON to Array in Swift
How to Set the Rootviewcontroller with Swift, iOS 7
How to Ensure to Run Some Code on Same Background Thread
Getting Random "Facebookerrdomain Error 10000"
How to Query Nearest Users in Firebase with Swift
Authentication with Wkwebview in Swift
iOS - Linking Framework Storyboard to Viewcontroller for Use in Main Project
Change Button Title Color in Uialertview
How to Mute/Unmute Audio When Playing Video Using Mpmovieplayercontroller
How to Access an Iboutlet from Another Class
Phonegap on iOS with Absolute Path Urls for Assets
How to Use Multiple Segues with One Uitableviewdelegate
Stuck on Using Mkpinannotationview() Within Swift and Mapkit
Array of Multiple Url's Nsfilemanager Swift