Steps to get App info in Phonegap

Posted By : Akhil Dhiman | 10-Nov-2014

 

In this blog I will show you how to get app info like bundle identifier, build no and version no in phonegap. For this we need to install cordova plugin name "cordova-plugin-appinfo".

 

You can download this plugin from below link https://github.com/yezhiming/cordova-plugin-appinfo

 

To add this plugin in your project follow the following procedure. Using terminal go in your project directory, from inside your cordova project you have to enter the following command.

 cordova plugin add https://github.com/yezhiming/cordova-plugin-appinfo
 

Now I will show you how to use this plugin. Below is the code to implement this plugin.

 navigator.appInfo.getVersion(function(args) {
    var version = args.version;
    var buildNo = args.build;
    var packageName = args.identifier;
    $('span#appVersion').html("Version:"+version+" || Build:"+buildNo);
});
 

In device ready event the code to get app info will be written. It will get the App info from config.xml and we can shown into any Place.

 

Thanks

About Author

Author Image
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.

Request for Proposal

Name is required

Comment is required

Sending message..