An open API service indexing awesome lists of open source software.

https://github.com/joncardasis/chronicle

:watch: An iOS version compatibility checker. Force upgrades and recommend new versions.
https://github.com/joncardasis/chronicle

force-upgrade ios json swift4 version versioning

Last synced: 10 months ago
JSON representation

:watch: An iOS version compatibility checker. Force upgrades and recommend new versions.

Awesome Lists containing this project

README

          


Chronicle

An iOS version checker



Swift 4
iOS Platform
Carthage Compatible
License

>Chronicle is a version compatibility checker for iOS applications.

## How it works
1. Host a properly formatted `json` file on your own server. Read more on formatting from the [Payload.md](Payload.md).
2. In the `application:didFinishLaunchingWithOptions:` (or likewise) method of your app's AppDelegate check for version compliance and handle accordingly.

## Example
`Chronicle` provides 3 block callbacks which are all optional callbacks.
> (1) Minimum version found, (2) recommended version found, (3) error occurred.

**Example**
```Swift
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.

## Why Chronicle?
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.

## JSON Payload Format
A formatted JSON payload served via your own server.

- See [ChronicleTests/JSON](ChronicleTests/JSON) for examples of the payload format.
- See [Payload.md](Payload.md) for formatting requirements

## License
Chronicle is available under the MIT license. See the LICENSE file for more info.