From 8b7852129b186e6a14a42eaac92def8a35a94936 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Wed, 17 Feb 2016 04:25:03 -0500 Subject: [PATCH 1/2] feat(): add app version plugin --- src/plugins/appversion.ts | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/plugins/appversion.ts diff --git a/src/plugins/appversion.ts b/src/plugins/appversion.ts new file mode 100644 index 000000000..6b92bd6bd --- /dev/null +++ b/src/plugins/appversion.ts @@ -0,0 +1,59 @@ +import {Plugin, Cordova} from './plugin'; + +/** + * Reads the version of your app from the target build settings. + * + * Requires Cordova plugin: cordova-plugin-appversion. For more info, please see the [cordova-plugin-version docs](ttps://github.com/whiteoctober/cordova-plugin-app-version). + * + * ``` + * ionic plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git + * ```` + * + * @usage + * ```js + * AppVersion.getAppName(); + * AppVersion.getPackageName(); + * AppVersion.getVersionCode(); + * AppVersion.getVersionNumber(); + * ``` + */ +@Plugin({ + name: 'AppRate', + plugin: 'cordova-plugin-appversion', + pluginRef: 'cordova.getAppVersion' +}) +export class AppVersion { + + /** + * Returns the name of the app + */ + @Cordova + static getAppName () : string { + return; + } + + /** + * Returns the package name of the app + */ + @Cordova + static getPackageName () : string { + return; + } + + /** + * Returns the build identifier of the app + */ + @Cordova + static getVersionCode () : string { + return; + } + + /** + * Returns the version of the app + */ + @Cordova + static getVersionNumber () : string { + return; + } + +} From 20cb01fd9e83b0a4328c3904fc1ad48c1921370d Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Wed, 17 Feb 2016 04:25:44 -0500 Subject: [PATCH 2/2] feat(): add app version plugin --- src/plugins/appversion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/appversion.ts b/src/plugins/appversion.ts index 6b92bd6bd..816c64619 100644 --- a/src/plugins/appversion.ts +++ b/src/plugins/appversion.ts @@ -18,7 +18,7 @@ import {Plugin, Cordova} from './plugin'; * ``` */ @Plugin({ - name: 'AppRate', + name: 'AppVersion', plugin: 'cordova-plugin-appversion', pluginRef: 'cordova.getAppVersion' })