插件获取PhoneGap App的版本? [英] Plugin to get the version of PhoneGap App?

查看:198
本文介绍了插件获取PhoneGap App的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PhoneGap构建来封装我的应用程序是否有任何PhoneGap或第三方插件,我可以包括在我的config.xml中获取应用程序的版本在运行时?

I am using PhoneGap build to package my app is there any PhoneGap or 3rd Party Plugin that I can include in my config.xml to get the version of the app in the runtime?

任何关于获得应用程序版本的最佳方式的建议都会被推荐。

Any suggestion on best way to get the version of the App would be appriciated.

推荐答案

iOS,Windows Phone 8和Android: http://plugreg.com/plugin/whiteoepober / cordova-plugin-app-version

This plugin works on iOS, Windows Phone 8 and Android: http://plugreg.com/plugin/whiteoctober/cordova-plugin-app-version

如果您使用的是Cordova CLI,可以通过以下方式安装:

If you're using the Cordova CLI, you can install via:

cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git

然后它就像:

cordova.getAppVersion(function (version) {
    alert(version);
});

(设备就绪功能启动后)

(after the device ready function has been fired)

这篇关于插件获取PhoneGap App的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆