Coder Social home page Coder Social logo

bmedenwald / smaupdatesavailable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simplymadeapps/smaupdatesavailable

0.0 1.0 0.0 21 KB

An easy to use library to check if there are iOS updates available for your application.

License: MIT License

Ruby 4.99% Objective-C 95.01%

smaupdatesavailable's Introduction

Build Status codecov

SMAUpdatesAvailable

Badge w/ Version Badge w/ Version

This library is an easy to use way to check if there are updates available for your application on the iOS App Store.

#RELEASE 1.0 This is the first iteration of this library and has all of the basic functionality to call out to Apple's lookup service and return the current data for your app. This means that your app must be approved and active in the App Store for this to work. Failsafes are built in at every step to return NO for updates available if anything were to change or not get returned correctly. This way you should be safe and comfortable putting the checks in without accidentally prompting the user to update.

#Versioning This library is predicated on the fact that you are using Semantic Versioning for your application. This means your versions are set as follows.

MAJOR.MINOR.PATCH

For this library to work your version must be an NSString (which is pretty easy since Apple requires it to be this way) and your items are separated with a period. Assuming you are versioning this way, this library will work for you.

##Version Types## You can specify in your check for udpates how precise you want your lookup to be. Maybe you only care about prompting users when you release a major or minor update, but don't want to hassle them for bug fixes.

SMAVersionTypeMajor // only prompts for update if major version changes
SMAVersionTypeMajorMinor // only prompts for update if major or minor version changes
SMAVersionTypeMajorMinorBug // only prompts for update if major, minor, or bug version changes
SMAVersionTypeDefault // will prompt for update at any level of update

#Example

[SMAUpdatesAvailable checkForUpdatesWithType:SMAVersionTypeMajorMinorBug onCompletion:^(SMAUpdateResponse *response) {
    if (response.updateAvailable) {
        // safe to prompt user to update your app
    } else {
        // no updates available 
    }
}];

The SMAUpdateResponse object contains all of the data used to check for the update. You can query the response and parse the data yourself if you like.

response.appVersion // current version of your app as reported by MainBundle
response.appStoreVersion // current version of your app as reported by Apple's lookup service (if returned)
response.updateAvailable // BOOL to quickly determine if update is available for your app
response.rawData // NSDictionary of the full response returned by Apple's lookup service (has a lot of Store information)
response.error // error returned in the event of failures at any point and can be helpful for user messages if needed

#Installation

  • #import "SMAUpdatesAvailable.h" where you want to check for updates
  • pod install SMAUpdatesAvailable
  • Copy source files to your project. Only SMAUpdatesAvailable and SMAUpdateResponse are required

##Requirements SMAUpdatesAvailable requires [iOS 8.0] or later. We will be working to make this availble to as many versions as we can after proper testing.

  • iOS 8.0 or later
  • tvOS 9.0 or later

##Credits SMAUpdatesAvailable was written for use in projects created by Simply Made Apps so we could help users update to the latest version of our apps.

##Creator Bill Burgess @billburgess

##License SMAUpdatesAvailable is available under the MIT license. See the LICENSE file for more information.

##What's Next

  • Testing that this works on older versions of iOS so we can safely add older versions of iOS.
  • Add support for Mac App Store updates.
  • Native/better support for Swift. Most of this is in place now, but a Swift branch would avoid bridginge headers.
  • Mocking library to round out the tests surrounding my network calls and getting data from the main bundle.
  • We welcome any pull requests or suggestions for this library.

smaupdatesavailable's People

Contributors

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