Latest 0.0.2
Homepage https://github.com/soragoto/SRGAppVerWatcher
License MIT
Platforms ios 6.0, requires ARC
Authors

CI Status
Version
License
Platform

SRGAppVerWatcher detect app-install or app-update, and you can your run code just one time at after app-install or app-updates by using blocks.

Installation

Add the following line to your podfile and run pod update.

pod 'SRGAppVerWatcher'

Usage

At first you need to include header file.

#import "SRGAppVerWatcher.h"

You can use a block that run just one time at after application install.

[[SRGAppVerWatcher sharedWatcher] executeOnceAfterInstall:^{
    // This blocks run just one time after install.
    // ( This block DOSE NOT RUN at after update )
    [yourObject introduceAppFeatures];
}];

You can use a block that run just one time at after application updates.

  • Blocks argments NSString *from : app-version before update.
  • Blocks argments NSString *to : app-version after update.
[[SRGAppVerWatcher sharedWatcher] executeOnceAfterUpdate:^(NSString *from, NSString*to){
    // This blocks run just one time after update.
    // ( This block DOSE NOT RUN at after install )
    [yourObject showWatsNewInUpdate];
    NSLog(@"Update version from:%@ to:%@",from,to);
}];

You can get date an app is installed ( or update ).

NSDate *installDate     = [[SRGAppVerWatcher sharedWatcher] installDate];
NSDate *updateDate      = [[SRGAppVerWatcher sharedWatcher] updateDate];
NSDate *updateDateVer3  = [[SRGAppVerWatcher sharedWatcher] updateDateOf:@"3.0"];

You can get version when app is installed .

NSString *installVersion = [[SRGAppVerWatcher sharedWatcher] installVersion];

Notes

SRGAppVerWatcher detect update or install by saving current version and compare previous version. So you need to install SRGAppVerWatcher from FIRST VERSION in your app, otherwise SRGAppVerWatcher can’t distinguish between update and install.

LICENSE

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

Latest podspec

{
    "name": "SRGAppVerWatcher",
    "version": "0.0.2",
    "summary": "SRGAppVerWatcher detect app-install or app-update, and hook your code.",
    "homepage": "https://github.com/soragoto/SRGAppVerWatcher",
    "license": "MIT",
    "authors": {
        "Norihiro Sakamoto": "[email protected]"
    },
    "source": {
        "git": "https://github.com/soragoto/SRGAppVerWatcher.git",
        "tag": "0.0.2"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This