Skip to content

lingdu0001/cordova-plugin-app-version

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova AppVersion plugin

Reads the version of your app from the target build settings.

Installation

With cordova-cli

If you are using cordova-cli, install with:

cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git

With plugman

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

Manually in iOS

TODO: Write these instructions

Manually in Android

TODO: Write these instructions

Use from Javascript

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:

About

Cordova plugin to return the version number of the current app

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 41.3%
  • Java 21.7%
  • Objective-C 20.6%
  • C# 16.4%