Giter VIP home page Giter VIP logo

chronicle's Introduction

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.
  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

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.

License

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

chronicle's People

Contributors

joncardasis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.