Reads the version of your app from the target build settings.
If you are using cordova-cli, install with:
cordova plugin add eeschiavo-cordova.plugin-appversion
If you are using jQuery or AngularJS, promise style is supported. Use something like:
cordova.getAppVersion.getVersionNumber().then(function (version) {
$('.version').text(version);
});
If not, pass a callback function:
cordova.getAppVersion.getVersionNumber(function (version) {
alert(version);
});
In addition to the version number you can also retrieve other details about your application:
Returns the name of the app. E.g. "My Awesome App"
Returns the package name of the app - the reversed domain name app identifier like com.example.myawesomeapp
Returns the build identifier of the app
Returns the version number of the app
### Credits
This is a fork modified under MIT license.