Latest 1.1.0
Homepage https://github.com/qiusuo8/AppInfoTracker
License MIT
Platforms ios 8.0, tvos 9.0, osx 10.10, watchos 2.0, requires ARC
Frameworks Foundation
Authors

AppInfoTracker
AppInfoTracker
AppInfoTracker
AppInfoTracker

AppInfoTracker is a lightweight, pure-Swift library for tracking times of start app and excute block when first launch for certain version or build of today. This project is inspired by VersionTrackerSwift.

Requirements

  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Swift 3

Main development of AppInfoTracker will support Swift 3.

Usage

In your ApplicationDelegate, call the method track to track the current version:

    // iOS / tvOS
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        AppInfoTracker.track()
        return true
    }
    // OS X
    func applicationDidFinishLaunching(aNotification: NSNotification) {
        AppInfoTracker.track()
        return true        
    }

Then, call whenever one of the following methods to get the data you need:

isFirstLaunchOfToday: Bool
isFirstLaunchForCurrentVersion: Bool
isFirstLaunchForCurrentVersionAndBuild: Bool

versionHistory: [String]

public static func isFirstLaunchForVersion(_ version: String, firstLaunchCompletion: (() -> Void)? = nil) -> Bool

public class func isFirstLaunchForVersion(_ version: String, build: String, firstLaunchCompletion: (() -> Void)? = nil) -> Bool

public class func isFirstLaunchForToday(firstLaunchCompletion: (() -> Void)? = nil) -> Bool

public class func currentVersion() -> String

public class func previousVersion() -> String?

public class func currentBuild() -> String

public class func numbersOfStartupsForVersion(_ version: String) -> Int

public class func numbersOfStartupsForVersion(_ version: String, build: String) -> Int

public class func numbersOfStartupsForToday() -> Int

Installation

CocoaPods

Add the following line in your Podfile:

pod 'AppInfoTracker'

Contribution

If you find an issue, just open a ticket. Pull requests are warmly welcome as well.

Licence

Kingfisher is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "AppInfoTracker",
    "version": "1.1.0",
    "summary": "App information tracker for your iOS, OS X, and tvOS app",
    "description": "AppInfoTrackern* Install versions history.n* Tell you is First launch for certain version or build or today.n* Tell you numbers of startups for app.",
    "homepage": "https://github.com/qiusuo8/AppInfoTracker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Zhao Zhihui": "[email protected]"
    },
    "social_media_url": "https://github.com/qiusuo8",
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0",
        "osx": "10.10",
        "watchos": "2.0"
    },
    "source": {
        "git": "https://github.com/qiusuo8/AppInfoTracker.git",
        "tag": "1.1.0"
    },
    "source_files": [
        "Sources/*.swift",
        "Sources/AppInfoTracker.h",
        "Sources/AppInfoTracker.swift"
    ],
    "public_header_files": [
        "Sources/AppInfoTracker.h"
    ],
    "requires_arc": true,
    "frameworks": "Foundation",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This