npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nativescript-version-tracking

v1.0.0

Published

Track which versions of your NativeScript App a user has previously installed.

Downloads

4

Readme

Bazzite Project Travis version License

NativeScript Version Tracking apple android

Track which versions of your NativeScript App, a user has previously installed.

Installation

Run the following command from the root of your project:

$ tns plugin add nativescript-version-tracking

Usage

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.

TypeScript

import * as app from 'tns-core-modules/application';
import versionTracking from 'nativescript-version-tracking';

app.on('launch', () => {
    versionTracking.init();
});

Javascript

var app = require('tns-core-modules/application');
var versionTracking = require('nativescript-version-tracking');

app.on('launch', function () {
    versionTracking.init();
});	

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:

versionTracking.isFirstLaunchEver;        // false
versionTracking.isFirstLaunchForVersion;  // true
versionTracking.isFirstLaunchForBuild;    // true

versionTracking.currentVersion;           // 2.0.1
versionTracking.previousVersion;          // 2.0.0
versionTracking.firstInstalledVersion;    // 1.0.0
versionTracking.versionHistory;           // [1.0.0, 1.0.1, 1.0.2, 2.0.0, 2.0.1]

versionTracking.currentBuild;             // 18
versionTracking.previousBuild;            // 15
versionTracking.firstInstalledBuild;      // 1
versionTracking.buildHistory;             // [1, 2, 3, 4, 5, 8, 9, 10, 11, 13, 15, 18]

versionTracking.firstLaunchForVersion('3.0.0')     // false
versionTracking.firstLaunchForBuild('20')          // false

API

Properties

| Property | Default | Description | |-------------------------|:-------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 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. |

Methods

| Method | Returns | Description | |------------------------------------------------|:-------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| | 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. |

Support

Professional Support

This project is sponsored by Bazzite. If you require assistance on your project(s), please contact us at https://www.bazzite.com/contact.

Contributing

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.

License

Code released under the MIT License.


Originally inspired by VersionTrackingPlugin.