Monitor iOS app version easily.

Overview

AppVersionMonitor

CI Status Version License Platform

Monitor iOS app version easily.

You can get previous version and installation history.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod "AppVersionMonitor"

Usage

Setup

// AppDelegate

func applicationDidFinishLaunching(application: UIApplication) {

    AppVersionMonitor.sharedMonitor.startup()
}

Get MarketingVersion (CFBundleShortVersionString)

let currentVersion: AppVersion = AppVersion.marketingVersion
let versionString: String = AppVersion.marketingVersion.versionString // "1.2.3"

Get installed version

let installedVersions: [AppVersion] = AppVersionMonitor.sharedMonitor.installedVersions

Compare Version

AppVersion.marketingVersion > AppVersion("1.2.3")
AppVersion("1.2.3") < AppVersion("3.2.1")
AppVersion("1.2.3") < "3.2.1"

You can check app version status easily.

switch AppVersionMonitor.sharedMonitor.state {
case .Installed:

// Do something when app installed.
// Happy! 🍻
// ex. Start tutorial.

case .NotChanged:

// Do something when version not changed.
// Peace 😌
// Nothing to do?

case .Upgraded(let previousVersion: AppVersion):

// Do something when version upgraded.
// Yeah! 😝
// ex. Migrate App Data.

case .Downgraded(let previousVersion: AppVersion):

// Do something when version downgraded. (Impossible normally)
// What happened? 😵
// ex. Purge App Data.

}

Author

muukii [email protected]

License

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

You might also like...
A Swift micro-framework to easily deal with weak references to self inside closures

WeakableSelf Context Closures are one of Swift must-have features, and Swift developers are aware of how tricky they can be when they capture the refe

Transform strings easily in Swift.

swift-string-transform Transform strings easily in Swift. Table of Contents Installation How to use Contribution Installation Swift Package Manager (R

Framework for easily parsing your JSON data directly to Swift object.
Framework for easily parsing your JSON data directly to Swift object.

Server sends the all JSON data in black and white format i.e. its all strings & we make hard efforts to typecast them into their respective datatypes

FeatureFlags.swift - Tools for easily defining feature flags for your projects

FeatureFlags.swift Tools for easily defining feature flags for your projects Int

This iOS framework allows settings to be in-app in addition to or instead of being in the Settings app.
This iOS framework allows settings to be in-app in addition to or instead of being in the Settings app.

InAppSettingsKit InAppSettingsKit (IASK) is an open source framework to easily add in-app settings to your iOS or Catalyst apps. Normally iOS apps use

TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app.
TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app.

TypeStyle TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app. Featu

A utility that reminds your iPhone app's users to review the app written in pure Swift.
A utility that reminds your iPhone app's users to review the app written in pure Swift.

SwiftRater SwiftRater is a class that you can drop into any iPhone app that will help remind your users to review your app on the App Store/in your ap

Mac app to change .ipa file app icons and display names

IPAEdit Mac app to change .ipa file app icon, display name, and app version to avoid updates Compatible with macOS 10.11+ Install To install either cl

A Flutter plugin (platform channel with Swift) to get the current app name and also bring our app to the front.

window_to_front A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package th

Comments
  • Updated Package.swift and swift version

    Updated Package.swift and swift version

    Primary changes were performed through XCode's swift migration tool to update the swift version to 5.0. Node code changes were needed, though some project file settings were modified to reflect this.

    This also updates the Package.swift for use with newer swift versions too and allows for other tools like Accio to build this as a dependency.

    opened by made2k 0
  • swiftlint

    swiftlint

    AppVersionMonitor produces errors and warnings when using swiftlint.

    AppVersionMonitor/AppVersion.swift:65:65: error: Force Cast Violation: Force casts should be avoided. (force_cast)

    AppVersionMonitor/AppVersion.swift:74:66: error: Force Cast Violation: Force casts should be avoided. (force_cast)

    AppVersionMonitor/AppVersion.swift:23: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)

    AppVersionMonitor/AppVersion.swift:110: warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)

    AppVersionMonitor/AppVersion.swift:41:9: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)

    AppVersionMonitor/AppVersionMonitor.swift:23: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)

    opened by fnolis 0
  • [Question] Installed state meet when after app update completed?

    [Question] Installed state meet when after app update completed?

    I have a question about installed state, app run to installed state when the first time install app or after update (or downgrade) app right? Sorry, I need to make sure this because I can't test this case at time. Thanks.

    opened by qhu91it 0
  • What does

    What does "startup()" do?

    @muukii

    Because looking at the code the "AppVersionMonitor.sharedMonitor.startup()" function is empty.

    open class AppVersionMonitor {   
    ...
        open func startup() {
              🤔
        }
            
    }
    
    opened by otymartin 1
Releases(1.4.1)
Owner
エウレカ
This is eureka, Inc. organization.
エウレカ
Monitor changes to files and directories using kernel event notifications (kqueue) in Swift

SKQueue SKQueue is a Swift libary used to monitor changes to the filesystem. It wraps the part of the kernel event notification interface of libc, kqu

Daniel Pedersen 86 Oct 26, 2022
Simple and Lightweight App Version Tracking for iOS written in Swift

AEAppVersion Simple and lightweight iOS App Version Tracking written in Swift I made this for personal use, but feel free to use it or contribute. For

Marko Tadić 12 Nov 11, 2022
Checks if there is a newer version of your app in the AppStore and alerts the user to update.

YiAppUpdater Checks if there is a newer version of your app in the AppStore and alerts the user to update. Installation YiAppUpdater is available thro

coderyi 4 Mar 17, 2022
Recreating a fully functional version of iOS 4 in SwiftUI.

Updates: Version 1.0 is currently available ?? While I work on fixing an issue in Xcode 12.5+ with LazyVGrid, I recommend you build using Xcode 12.4 a

null 2.9k Jan 1, 2023
Alert popup to notify your users if they use an unsupported iOS version

UnsupportedOSVersionAlert This source code alerts your users if they use your app with an unsupported version of iOS (e.g. iOS 10.0 beta). The alert l

Josef Moser 8 Mar 11, 2019
Prueba versión Swift

?? APOD-SoyYO-Swift ?? Prueba técnica Dependencias: Cocoapods ¿Como correr el App? Descarga el proyecto usando git git clone https://github.com/hd3vC0

Humberto M. 0 Dec 23, 2021
A simple utility allowing to detect Swift version at runtime.

SwiftVersionDetector SwiftVersionDetector allows you to detect Swift version at runtime. Note that detecting the Swift version of the machine on which

Alessandro Venturini 2 Dec 3, 2022
WhatsNewKit enables you to easily showcase your awesome new app features.

WhatsNewKit enables you to easily showcase your awesome new app features. It's designed from the ground up to be fully customized to your needs. Featu

Sven Tiigi 2.8k Jan 3, 2023
A library that helps developers to easily perform file-related operations In iOS

File Operations Preview A library that helps developers to easily perform file-related operations. In iOS, We write our files mainly into three direct

Rinto Andrews 1 Oct 15, 2021
FluxCapacitor makes implementing Flux design pattern easily with protocols and typealias.

FluxCapacitor makes implementing Flux design pattern easily with protocols and typealias. Storable protocol Actionable protocol Dispatch

Taiki Suzuki 123 Aug 23, 2022