Chronicle is a version compatibility checker for iOS applications.
- Host a properly formatted
json
file on your own server. Read more on formatting from the Payload.md. - In the
application:didFinishLaunchingWithOptions:
(or likewise) method of your app's AppDelegate check for version compliance and handle accordingly.
Chronicle
provides 3 block callbacks which are all optional callbacks.
(1) Minimum version found, (2) recommended version found, (3) error occurred.
Example
Chronicle().checkForUpdates(from: url,
requiredVersion: { (version, isMinimumVersionSatisfied, notificationType) in
if notificationType == .once {
if !isMinimumVersionSatisfied {
print("""
Version \(version.version) is available.
You are required to download this version to continue using this application.
Visit \(version.storeUrl) to upgrade.
""")
}
},
recommendedVersion: { (version, isMinimumVersionSatisfied, notificationType) in
if !isMinimumVersionSatisfied {
print("""
Version \(version.version) is available!
Attached message: \(version.message)
You should go and download it!
""")
}
}) { (error) in
// Usually don't want to display anything to user at this point
}
Check out the ChronicleExample build target for more.
Obtaining current version info from the App Store directly is the best way to ensure your users are receiving notifications for app versions which actually exist.
However, this project serves as a force-upgrade module for you to modify the required versions at any time via a simple json file.
For example, this is useful if an API breaking change was implemented and users who run versions less than 2.0 would be hitting incorrect endpoints.
A formatted JSON payload served via your own server.
- See ChronicleTests/JSON for examples of the payload format.
- See Payload.md for formatting requirements
Chronicle is available under the MIT license. See the LICENSE file for more info.