SSAppUpdater is an open-source framework that compares the current version of the app with the store version and returns the essential details of it like app URL, new app version number, new release note, etc. So you can either redirect or notify the user to update their app.
SSAppUpdater is an open-source framework that compares the current version of the app with the store version and returns the essential details of it like app URL, new app version number, new release note, etc. So you can either redirect or notify the user to update their app.
Force Update | Optional Update | Skip Version |
---|---|---|
You can use CocoaPods to install SSAppUpdater by adding it to your Podfile:
use_frameworks!
pod 'SSAppUpdater'
import SSAppUpdater
SSAppUpdater
by going to your Project settings > Swift Packages
and add the repository by providing the GitHub URL. Alternatively, you can go to File
> Swift Packages
> Add Package Dependencies...
dependencies: [
.package(url: "https://github.com/SimformSolutionsPvtLtd/SSAppUpdater.git", from: "1.1.0")
]
$ brew update
$ brew install carthage
To integrate SSAppUpdater
into your Xcode project using Carthage, add the following line to your Cartfile
:
github ""SimformSolutionsPvtLtd/SSAppUpdater""
Run carthage
to build and drag the SSAppUpdater
(Sources/SSAppUpdater) into your Xcode project.
SSAppUpdater compares the currently installed version of your iOS app with the new store version that is currently available in the App Store. When an update is available, SSAppUpdater is able to present the new version number, Appstore URL, App ID, and release notes to the user giving them the choice to update.
How does SSAppUpdater achieve this? Firstly, it makes use of the iTunes Search API to retrieve the information.
isForceUpdate: false
updateAlertFrequency: .always
showDefaultAlert: true
Along with this, the isForceUpdate
Boolean value checks that the user wants to force update or not.
Using the updateAlertFrequency, the user can choose alert display time. default value will be .always
. Alternative values of this property are daily
,weekly
and monthly
.
The SSAppUpdater allow developers to create a custom UI if needed. showDefaultAlert
Boolean value checks that the user wants to show default Alert or Custom UI.
AppDelegate.swift
or anywhere in your app you need. (The block will return the version information)import SSAppUpdater
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
window?.makeKeyAndVisible()
//defaultExample
SSAppUpdater.shared.performCheck { (versionInfo) in
// Version Info have all the app update releated information
// Display AppUpdate UI based on versionInfo.isAppUpdateAvailable flag
}
//customExample
SSAppUpdater.shared.performCheck(isForceUpdate: false, updateAlertFrequency: .always, showDefaultAlert: true) { (versionInfo) in
// Version Info have all the app update releated information
}
}
}