Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pavel-durov/cordova-plugin-app-version
Cordova plugin to return the version number of the current app
https://github.com/pavel-durov/cordova-plugin-app-version
Last synced: about 2 months ago
JSON representation
Cordova plugin to return the version number of the current app
- Host: GitHub
- URL: https://github.com/pavel-durov/cordova-plugin-app-version
- Owner: Pavel-Durov
- License: mit
- Fork: true (sampart/cordova-plugin-app-version)
- Created: 2015-11-05T07:39:53.000Z (about 9 years ago)
- Default Branch: develop
- Last Pushed: 2015-11-05T07:59:03.000Z (about 9 years ago)
- Last Synced: 2023-02-26T04:55:46.453Z (over 1 year ago)
- Language: JavaScript
- Size: 127 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Cordova AppVersion plugin
Reads the version of your app from the target build settings.
## Installation
### With cordova-cli
If you are using [cordova-cli](https://github.com/apache/cordova-cli), install
with:cordova plugin add cordova-plugin-app-version
### With plugman
With a plain [plugman](https://github.com/apache/cordova-plugman), you should be
able to install with something like:plugman --platform --project --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, AngularJS, WinJS or any Promise/A library (Bluebird), 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:
### getAppName
Returns the name of the app. E.g. "My Awesome App"
### getPackageName
Returns the package name of the app - the reversed domain name app identifier like com.example.myawesomeapp
### getVersionCode
Returns the build identifier of the app
### getVersionNumber
Returns the version number of the app
## Credits
Written by [Robert (Jamie) Munro](http://twitter.com/rjmunro) at
[White October](http://whiteoctober.co.uk/)Various others have contributed fixes and new features. See the CHANGELOG.md for details.
Original code based on the following Stack Overflow posts:
* [iOS](http://stackoverflow.com/a/14713364/3408)
* [Android](http://stackoverflow.com/a/3637686/3408)