本文介绍了如何使用Cordova获取当前已安装应用程序的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找到 AppAvailability插件,该插件基本上可以检查用户是否在其设备上安装了某个应用.

I already found AppAvailability plugin which basically checks if a user installed a certain app on his device.

应用程序的当前版本,开发人员名称(重要)及其可能的所有功能是否可能?通常这是否可能?

Is there a possibility to the current version of the app, developer name (important) and everything it possibly can? Is this even possible in general?

推荐答案

使用 AppAvailability插件无法获得该应用程序的当前版本.

Using AppAvailability plugin it is not possible to get the current version of the app.

您必须使用 Cordova AppVersion插件.

安装后(例如cordova plugin add cordova-plugin-app-version),您可以使用以下JS代码:

After install (e.g. cordova plugin add cordova-plugin-app-version), you can this JS code:

cordova.getAppVersion.getVersionNumber().then(function (version) {
    $('.version').text(version);
});

以下是可用于检索有关应用程序的其他详细信息的方法的列表:

Here is the list of methods which you can use to retrieve other details about your application:

  • getAppName

  • getPackageName

  • getVersionCode

  • getVersionNumber

  • 相关帖子:

    • How to get the application version and build in an iOS PhoneGap Application?
    • User versionName value of AndroidManifest.xml in code

    这篇关于如何使用Cordova获取当前已安装应用程序的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    07-23 10:06
    查看更多