Reads the version of your app from the target build settings.
If you are using cordova-cli, install with:
cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git
With a plain plugman, you should be able to install with something like:
plugman --platform <ios|android> --project <directory> --plugin https://github.com/whiteoctober/cordova-plugin-app-version.git
TODO: Write these instructions
TODO: Write these instructions
If you are using jQuery, use:
cordova.getAppVersion.getVersionNumber().then(function (version) {
$('.version').text(version);
});
cordova.getAppVersion.getVersionCode().then(function (code) {
$('.code').text(code);
});
If not:
cordova.getAppVersion.getVersionNumber(function (version) {
alert(version);
});
cordova.getAppVersion.getVersionCode(function (code) {
alert(code);
});
## Credits
Written by Robert (Jamie) Munro at White October
Code based on the following Stack Overflow posts: