2016-07-08 00:33:53 +02:00
|
|
|
import { Cordova, Plugin } from './plugin';
|
2016-02-17 04:25:03 -05:00
|
|
|
|
|
|
|
/**
|
2016-03-13 15:45:07 -04:00
|
|
|
* @name App Version
|
2016-03-12 18:30:16 -05:00
|
|
|
* @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
|
2016-03-24 13:00:18 -04:00
|
|
|
* 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()
|
2016-04-29 23:56:49 -04:00
|
|
|
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()
|
2016-04-29 23:56:49 -04:00
|
|
|
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()
|
2016-04-29 23:56:49 -04:00
|
|
|
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()
|
2016-04-29 23:56:49 -04:00
|
|
|
static getVersionNumber(): Promise<any> { return; }
|
2016-02-17 04:25:03 -05:00
|
|
|
|
|
|
|
}
|