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
More From Oodles
Neha N | 14-Mar-2025
Ready to innovate? Let's get in touch
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.