GithubHelp home page GithubHelp logo

carabina / appstoreversion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imac0de/appstoreversion

0.0 1.0 0.0 89 KB

An easy Swift framework to check your latest app version available on the AppStore and compare it to the installed version.

License: MIT License

Ruby 14.31% Objective-C 6.47% Swift 79.22%

appstoreversion's Introduction

AppStoreVersion

Because it is not always easy to maintain some features depending on the versions installed, especially if you have a REST API that is evolving with the app you are developing, I decide to create this framework to check if the users have the latest version available.

Version Build Status License Platform Swift

Install

AppStoreVersion is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'AppStoreVersion'

Usage

The usage of this framework is very simple. You have two ways to check if the installed version is the latest available.

The easiest way ๐Ÿ˜Ž

If you want to let the framework manage the prompt alert to your users, just call in your code where you want to check the version:

AppStoreVersion.check(bundle: Bundle.main)

If the installed version of your app is the latest, it will do nothing. If it is not the latest, it will prompt an UIAlertViewController with an UIAlertAction to redirect yours users to the page of your app in the AppStore.

The freedom way ๐Ÿš€

If you want to manage the display to your users, it is also very simple, you just need to call:

AppStoreVersion.check(bundle: Bundle.main) { (upToDate, error) in
    if error != nil {
        print(error!.localizedDescription)
    } else if !upToDate {
	    //TODO: Display to the users that their not using the latest version.
    }
}

Localization

This framework is based on the current device localization and will display, if there is no localization translations for the current locale, the english version will be used.

Available

๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿ‡ซ๐Ÿ‡ท

Add a localization

Looking for a translation? Create a pull request or open an issue.

Key Example
AppStoreVersion.NewVersionTitle New Version Available !ย 
AppStoreVersion.NewVersionMessage The version %@ is available on the AppStore.
AppStoreVersion.Download Download
AppStoreVersion.Later Later

Config

In order to be a very flexible framework, you can configure some features and data directly from your code.

For example, by default, the prompt alert displayed by the framework give to the users a "Later" button which will hide the UIAlertViewController. If you want to force your users to download the latest version, just say it:

AppStoreVersion.Config.optional = false

You can also configure the localization yourself:

AppStoreVersion.Config.Alert.title = "New version!"
AppStoreVersion.Config.Alert.message = "Find out our new features."
AppStoreVersion.Config.Alert.downloadActionTitle = "Let's do it!"
AppStoreVersion.Config.Alert.laterActionTitle = "No, thanks."

Default values

Config Default
AppStoreVersion.Config.optional true
AppStoreVersion.Config.Alert.title NSLocalizedString("AppStoreVersion.NewVersionTitle", comment: "")
AppStoreVersion.Config.Alert.message NSLocalizedString("AppStoreVersion.NewVersionMessage", comment: "")
AppStoreVersion.Config.Alert.downloadActionTitle NSLocalizedString("AppStoreVersion.Download", comment: "")
AppStoreVersion.Config.Alert.laterActionTitle NSLocalizedString("AppStoreVersion.Later", comment: "")

Contribute

This framework is very simple, and I want it to stay like this. But any new features or suggestions are always welcome, so feel free to create a pull request or open an issue.

Author

Made with โค๏ธ by iMac0de from Bordeaux, France ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿท

Apps using this framework

Elyot

appstoreversion's People

Contributors

imac0de avatar

Watchers

 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.