57 lines
1.3 KiB
TypeScript
Raw Normal View History

2016-02-17 04:25:03 -05:00
import {Plugin, Cordova} from './plugin';
/**
2016-03-13 15:45:07 -04:00
* @name App Version
* @description
2016-02-17 04:25:03 -05:00
* Reads the version of your app from the target build settings.
*
2016-03-06 13:19:50 -08:00
* Requires Cordova plugin: `cordova-plugin-app-version`. For more info, please see the [Cordova App Version docs](https://github.com/whiteoctober/cordova-plugin-app-version).
2016-02-17 04:25:03 -05:00
*
* @usage
* ```js
* import {AppVersion} from 'ionic-native';
*
*
2016-02-17 04:25:03 -05:00
* AppVersion.getAppName();
* AppVersion.getPackageName();
* AppVersion.getVersionCode();
* AppVersion.getVersionNumber();
* ```
*/
@Plugin({
2016-03-04 15:42:21 -06:00
plugin: 'cordova-plugin-app-version',
2016-03-12 19:08:47 -05:00
pluginRef: 'cordova.getAppVersion',
2016-03-14 13:38:35 -04:00
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',
platforms: ['Android', 'iOS']
2016-02-17 04:25:03 -05:00
})
export class AppVersion {
/**
* Returns the name of the app
2016-03-04 15:42:21 -06:00
* @returns {Promise}
2016-02-17 04:25:03 -05:00
*/
2016-03-04 15:42:21 -06:00
@Cordova()
static getAppName(): Promise<any> { return; }
2016-02-17 04:25:03 -05:00
/**
* Returns the package name of the app
2016-03-04 15:42:21 -06:00
* @returns {Promise}
2016-02-17 04:25:03 -05:00
*/
2016-03-04 15:42:21 -06:00
@Cordova()
static getPackageName(): Promise<any> { return; }
2016-02-17 04:25:03 -05:00
/**
* Returns the build identifier of the app
2016-03-04 15:42:21 -06:00
* @returns {Promise}
2016-02-17 04:25:03 -05:00
*/
2016-03-04 15:42:21 -06:00
@Cordova()
static getVersionCode(): Promise<any> { return; }
2016-02-17 04:25:03 -05:00
/**
* Returns the version of the app
2016-03-04 15:42:21 -06:00
* @returns {Promise}
2016-02-17 04:25:03 -05:00
*/
2016-03-04 15:42:21 -06:00
@Cordova()
static getVersionNumber(): Promise<any> { return; }
2016-02-17 04:25:03 -05:00
}