awesome-cordova-plugins/src/plugins/appversion.ts

57 lines
1.3 KiB
TypeScript
Raw Normal View History

2016-07-08 06:33:53 +08:00
import { Cordova, Plugin } from './plugin';
2016-02-17 17:25:03 +08:00
/**
2016-03-14 03:45:07 +08:00
* @name App Version
* @description
2016-02-17 17:25:03 +08:00
* Reads the version of your app from the target build settings.
*
2016-03-07 05: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 17:25:03 +08:00
*
* @usage
* ```typescript
* import { AppVersion } from 'ionic-native';
*
*
2016-02-17 17:25:03 +08:00
* AppVersion.getAppName();
* AppVersion.getPackageName();
* AppVersion.getVersionCode();
* AppVersion.getVersionNumber();
* ```
*/
@Plugin({
2016-03-05 05:42:21 +08:00
plugin: 'cordova-plugin-app-version',
2016-03-13 08:08:47 +08:00
pluginRef: 'cordova.getAppVersion',
2016-03-15 01:38:35 +08:00
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',
platforms: ['Android', 'iOS']
2016-02-17 17:25:03 +08:00
})
export class AppVersion {
/**
* Returns the name of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getAppName(): Promise<any> { return; }
2016-02-17 17:25:03 +08:00
/**
* Returns the package name of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getPackageName(): Promise<any> { return; }
2016-02-17 17:25:03 +08:00
/**
* Returns the build identifier of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getVersionCode(): Promise<any> { return; }
2016-02-17 17:25:03 +08:00
/**
* Returns the version of the app
2016-03-05 05:42:21 +08:00
* @returns {Promise}
2016-02-17 17:25:03 +08:00
*/
2016-03-05 05:42:21 +08:00
@Cordova()
static getVersionNumber(): Promise<any> { return; }
2016-02-17 17:25:03 +08:00
}