From 3088df441ba903ec5eb3e7171621844d7ced578e Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Wed, 17 Feb 2016 04:36:38 -0500 Subject: [PATCH 1/2] feat(): add badge plugin --- .idea/workspace.xml | 366 +++++++++++++++++++++++++++++++++++++++++++ src/plugins/badge.ts | 68 ++++++++ 2 files changed, 434 insertions(+) create mode 100644 .idea/workspace.xml create mode 100644 src/plugins/badge.ts diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000..1b3e9df66 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $PROJECT_DIR$ + true + + bdd + + DIRECTORY + + false + + + + + + + + + + + 1455573664683 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/plugins/badge.ts b/src/plugins/badge.ts new file mode 100644 index 000000000..592ae79db --- /dev/null +++ b/src/plugins/badge.ts @@ -0,0 +1,68 @@ +import {Plugin, Cordova} from './plugin'; + +/** + * The essential purpose of badge numbers is to enable an application to inform its users that it has something for them — for example, unread messages — when the application isn’t running in the foreground. + * + * Requires Cordova plugin: cordova-plugin-badge. For more info, please see the [cordova-plugin-badge docs](https://github.com/katzer/cordova-plugin-badge). + * + * ``` + * ionic plugin add https://github.com/katzer/cordova-plugin-badge.git + * ```` + * + * @usage + * ```js + * Badge.setBadge(10); + * Badge.increaseBadge(); + * Badge.clearBadge(); + * ``` + */ +@Plugin({ + name: 'Badge', + plugin: 'cordova-plugin-badge', + pluginRef: 'cordova.plugins.notification.badge' +}) +export class Badge { + + /** + * Determine permission to set badge notifications + */ + @Cordova() + static hasPermission () : boolean { + return; + } + + /** + * Register permission to set badge notifications + * @returns {Promise} + */ + @Cordova() + static registerPermission () : Promise { + return new Promise((res,rej) => {}); + } + + /** + * Sets the badge number + * @param number + */ + @Cordova() + static setBadge (number : number) : void {} + + /** + * Clears the badge number + */ + @Cordova() + static clearBadge () : void {} + + /** + * Increases the badge number + */ + @Cordova() + static increaseBadge () : void {} + + /** + * Decreases the badge number + */ + @Cordova() + static decreaseBadge () : void {} + +} From 7f01fb2b2a94c827878ab069e7b0f3516cba4975 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Wed, 17 Feb 2016 04:37:02 -0500 Subject: [PATCH 2/2] feat(): add badge plugin --- .idea/workspace.xml | 366 -------------------------------------------- 1 file changed, 366 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 1b3e9df66..000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $PROJECT_DIR$ - true - - bdd - - DIRECTORY - - false - - - - - - - - - - - 1455573664683 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file