Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plugin to get the version of PhoneGap App?

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.

like image 816
Hemantsom Avatar asked Apr 28 '14 14:04

Hemantsom


People also ask

What is PhoneGap plugin?

Apache Cordova and Adobe PhoneGap provide a way for developers to develop apps for all major platforms in HTML, CSS and JavaScript. Developers only have to maintain a single codebase for all platforms. The project started out as PhoneGap and when it was acquired by Adobe the code was released as Apache Cordova.

How do I get the app version in ionic?

Using getVersionNumber function you can get the version.

How you can upgrade PhoneGap?

For Android you just need to replace your . jar/. js files with the 1.2 versions and update the script tag to refer to the phonegap-1.2.


1 Answers

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

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

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

Then it's as simple as:

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

(after the device ready function has been fired)

like image 104
Lee Crossley Avatar answered Sep 22 '22 17:09

Lee Crossley