Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eddyverbruggen/nativescript-appversion
:1234: NativeScript plugin to retrieve your app's package ID and current version
https://github.com/eddyverbruggen/nativescript-appversion
nativescript nativescript-plugin version
Last synced: 4 months ago
JSON representation
:1234: NativeScript plugin to retrieve your app's package ID and current version
- Host: GitHub
- URL: https://github.com/eddyverbruggen/nativescript-appversion
- Owner: EddyVerbruggen
- License: mit
- Created: 2015-05-12T19:07:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T13:57:03.000Z (about 2 years ago)
- Last Synced: 2024-10-09T22:40:14.246Z (4 months ago)
- Topics: nativescript, nativescript-plugin, version
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 48
- Watchers: 4
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NativeScript AppVersion
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[![Twitter Follow][twitter-image]][twitter-url][npm-image]:http://img.shields.io/npm/v/nativescript-appversion.svg
[npm-url]:https://npmjs.org/package/nativescript-appversion
[downloads-image]:http://img.shields.io/npm/dm/nativescript-appversion.svg
[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social&label=Follow%20me
[twitter-url]:https://twitter.com/eddyverbruggenRead 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
```js
var appversion = require("nativescript-appversion");
```#### TypeScript
```typescript
import * as appversion from "nativescript-appversion";
```### getVersionName(Sync)
`getVersionNameSync` is the same as `getVersionName`, except it doesn't return a Promise.#### JavaScript
```js
appversion.getVersionName().then(function(v) {
console.log("Your app's version is: " + v);
});
```#### TypeScript
```typescript
appversion.getVersionName().then((v: string) => {
console.log("Your app's version is: " + v);
});
```### getVersionCode(Sync)
#### JavaScript
```js
appversion.getVersionCode().then(function(v) {
console.log("Your app's version code is: " + v);
});
```#### TypeScript
```typescript
appversion.getVersionCode().then((v: string) => {
console.log("Your app's version code is: " + v);
});
```### getAppId(Sync)
#### JavaScript
```js
appversion.getAppId().then(function(id) {
console.log("Your app's id is: " + id);
});
```#### TypeScript
```typescript
appversion.getAppId().then((id: string) => {
console.log("Your app's id is: " + id);
});
```