Nativescript: How to require name and version of nativescript in runtime.

Created on 12 Oct 2019  路  3Comments  路  Source: NativeScript/NativeScript

Hi. NS.
I want get name and version of nativescript in my App.
It's similar using const {name, version } = require("react-native/package.json"); in RN.

question

Most helpful comment

Use appversion

import * as appversion from "nativescript-appversion";

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

All 3 comments

Use appversion

import * as appversion from "nativescript-appversion";

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

:wave: @Joy1024, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please, use Stackoverflow to get help.

Use appversion

import * as appversion from "nativescript-appversion";

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

I try the code above.
I want get name and version of NativeScript not myApp.
It expect is name:NativeScript version:6.1.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fmmsilva picture fmmsilva  路  3Comments

rLoka picture rLoka  路  3Comments

NordlingDev picture NordlingDev  路  3Comments

OscarLopezArnaiz picture OscarLopezArnaiz  路  3Comments

Leo-lay picture Leo-lay  路  3Comments