Steps to know the version of the application in PhoneGap
Posted By : Akhil Dhiman | 22-Sep-2014
Here I will show you how one can get his application version and shown into a div.
Plugin to use:
I used plugin named Cordova AppVersion you can use the following link to check the plugin at Github
https://github.com/mclear/NFC_Ring_Control/tree/master/plugins/uk.co.whiteoctober.cordova.AppVersion
To add this plugin in your project follow the following procedure -
Download the zip file from the above link.
Using terminal go in your project directory, from inside your cordova project you have to enter the following command
Using terminal go in your project directory, from inside your cordova project you have to enter the following command
cordova plugin add {path to downloaded plugin}
Now I will show you how to use this plugin. Below is the code to implement this plugin
var version_name = "";
document.addEventListener("deviceready", function(){
cordova.getAppVersion(function (version) {
version_name = version;
$('span#appVersion').html("Version:"+version);
});
}, false);
In device ready event the code to get version of app is written. It will get the version of App from config.xml and we can shown into any Place.
Thanks
More From Oodles
Neha N | 14-Mar-2025
Ready to innovate? Let's get in touch
Request for Proposal
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Akhil Dhiman
Akhil is an iPhone and Android application developer with experience in PhoneGap and Swift(Native iOS). Akhil has good experience working with JavaScript, jQuery and Underscore as well.