@nativescript/appversion
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

NativeScript AppVersion

NPM version Downloads Twitter Follow

Read the current Package ID and Version (name and code) of your NativeScript app.

Installation

Run the following command from the root of your project:

tns plugin add @nativescript/appversion

Usage

To use this plugin you must first require / import it:

JavaScript

var appversion = require("@nativescript/appversion");

TypeScript

import * as appversion from "@nativescript/appversion";

getVersionName(Sync)

getVersionNameSync is the same as getVersionName, except it doesn't return a Promise.

JavaScript

  appversion.getVersionName().then(function(v) {
      console.log("Your app's version is: " + v);
  });

TypeScript

  appversion.getVersionName().then((v: string) => {
      console.log("Your app's version is: " + v);
  });

getVersionCode(Sync)

JavaScript

  appversion.getVersionCode().then(function(v) {
      console.log("Your app's version code is: " + v);
  });

TypeScript

  appversion.getVersionCode().then((v: string) => {
      console.log("Your app's version code is: " + v);
  });

getAppId(Sync)

JavaScript

  appversion.getAppId().then(function(id) {
      console.log("Your app's id is: " + id);
  });

TypeScript

  appversion.getAppId().then((id: string) => {
      console.log("Your app's id is: " + id);
  });

Package Sidebar

Install

npm i @nativescript/appversion

Weekly Downloads

1,569

Version

2.0.0

License

MIT

Unpacked Size

8.48 kB

Total Files

7

Last publish

Collaborators

  • mukaschultze
  • nativescript-user
  • tns-bot
  • lini
  • tachev
  • rosen-vladimirov
  • stoskov
  • rosen_vladimirov
  • walkerrunpdx
  • bradmartin
  • davecoffin
  • rigor789
  • nativescript-bot
  • multishiv19
  • eddyverbruggen
  • edusperoni
  • facetious
  • tdermendjiev
  • sis0k0