美文网首页Cordova原生插件
(App 版本)App Version

(App 版本)App Version

作者: 待花谢花开 | 来源:发表于2017-06-28 14:39 被阅读40次

App Version

从目标构建设置中读取您的应用的版本。
需要Cordova插件:cordova-plugin-app-version
。 有关更多信息,请参阅 Cordova App Version docs.
Repo(备用): https://github.com/whiteoctober/cordova-plugin-app-version

Installation(安装)

1.安装Cordova和Ionic插件:

$ ionic cordova plugin add cordova-plugin-app-version
$ npm install --save @ionic-native/app-version

2.添加插件到app's module

Supported platforms(支持平台)

Android
iOS
Windows

Usage(用法)

import { AppVersion } from '@ionic-native/app-version';

constructor(private appVersion: AppVersion) { }

...


this.appVersion.getAppName();
this.appVersion.getPackageName();
this.appVersion.getVersionCode();
this.appVersion.getVersionNumber();

Instance Members(实例成员)

getAppName()

返回app名称
****Returns:** Promise<any>

getPackageName()

返回app包名
****Returns:** Promise<any>

getVersionCode()

返回app的构建标识符
****Returns:** Promise<any>

getVersionNumber()

返回app的版本号
****Returns:** Promise<any>

相关文章

网友评论

    本文标题:(App 版本)App Version

    本文链接:https://www.haomeiwen.com/subject/neeucxtx.html