NativeScript Version Tracking
Track which versions of your NativeScript App, a user has previously installed.
Run the following command from the root of your project:
$ tns plugin add nativescript-version-tracking
The best way to explore the usage of the plugin is to inspect the demo app in the plugin's root folder.
Initialize the plugin
This plugin needs to be initialized when your app starts.
var app = ;var versionTracking = ;app;
Use the API
You can make use of the plugin whenever you want. For example, a user has launched several previous versions, and this is the first time he's launched the new version 2.0.1:
versionTrackingisFirstLaunchEver; // falseversionTrackingisFirstLaunchForVersion; // trueversionTrackingisFirstLaunchForBuild; // trueversionTrackingcurrentVersion; // 2.0.1versionTrackingpreviousVersion; // 2.0.0versionTrackingfirstInstalledVersion; // 1.0.0versionTrackingversionHistory; // [1.0.0, 1.0.1, 1.0.2, 2.0.0, 2.0.1]versionTrackingcurrentBuild; // 18versionTrackingpreviousBuild; // 15versionTrackingfirstInstalledBuild; // 1versionTrackingbuildHistory; // [1, 2, 3, 4, 5, 8, 9, 10, 11, 13, 15, 18]versionTracking // falseversionTracking // false
|isFirstLaunchEver||-||Check if this is the first time ever that the app is launched.|
|isFirstLaunchForVersion||-||Check if this is the first time the current version is being launched.|
|isFirstLaunchForBuild||-||Check if this is the first time the current build is being launched.|
|currentVersion||-||Returns the current version of the app.|
|previousVersion||-||Returns the previous version of the app.|
|firstInstalledVersion||-||Returns the version which the user first installed the app.|
|versionHistory||||Returns a list of versions which the user has had installed, e.g. ['2.1', '3.5', '4.0', '4.1']. The List is ordered from the first version installed to (including) the current version|
|currentBuild||-||Returns the current build of the app.|
|previousBuild||-||Returns the previous build of the app.|
|firstInstalledBuild||-||Returns the build which the user first installed the app.|
|buildHistory||||Returns a list of builds which the user has had installed, e.g. ['2100', '3500', '4000', '4100']. The List is ordered from the first build installed to (including) the current build.|
|init(versionsKey?: string, buildsKey?: string)||void||Initializes the plugin. Calling this method is required. A good place to call it is at the application onLaunch() method.|
|firstLaunchForVersion(version: string)||boolean||Check if this is the first launch for a particular version number. Useful if you want to execute some code for the first time launches of a particular version.|
|firstLaunchForBuild(build: string)||boolean||Check if this is the first launch for a particular build number. Useful if you want to execute some code for the first time launches of a particular build.|
For questions and support, use the Issues section.
You may also want to follow the company supporting this project on Twitter.
Please make sure to read the Contributing Guide before making a pull request.
Code of Conduct
Everyone participating in this project is expected to agree to abide by the Code of Conduct.
Code released under the MIT License.
Originally inspired by VersionTrackingPlugin.