$ cordova plugin add org.binarypark.cordova.plugins.version
This plugin should work on any platform since it does not rely on any native code.
versionto not override other plugins see issue 2
/see issue 1
cordova plugin add org.binarypark.cordova.plugins.version
The plugin will then be accessable via
<?xml version='1.0' encoding='utf-8'?> <widget id="my.app.id" version="1.5.0">...</widget>
window.cordova.plugins.version.getAppVersion() will return the version
The plugins uses the
before_prepare hook to generate the
getAppVersion.js file which will be added to the App on build. The
getAppVersion.js file which comes with the plugin is just a placeholder, as it should be available when the plugin is installed.
getAppVersion.js is regenerated on every build, you should not add it under version control!