UNPKG

ionic-native

Version:

Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support

98 lines 3.43 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { Cordova, Plugin } from './plugin'; /** * @name Badge * @description * 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 [Badge plugin docs](https://github.com/katzer/cordova-plugin-badge). * * @usage * ```typescript * import { Badge } from 'ionic-native'; * * * Badge.set(10); * Badge.increase(1); * Badge.clear(); * ``` */ export var Badge = (function () { function Badge() { } /** * Clear the badge of the app icon. * @returns {Promise<boolean>} */ Badge.clear = function () { return; }; /** * Set the badge of the app icon. * @param {number} badgeNumber The new badge number. * @returns {Promise<any>} */ Badge.set = function (badgeNumber) { return; }; /** * Get the badge of the app icon. * @returns {Promise<any>} */ Badge.get = function () { return; }; /** * Increase the badge number. * @param {number} increaseBy Count to add to the current badge number * @returns {Promise<any>} */ Badge.increase = function (increaseBy) { return; }; /** * Decrease the badge number. * @param {number} decreaseBy Count to subtract from the current badge number * @returns {Promise<any>} */ Badge.decrease = function (decreaseBy) { return; }; /** * Determine if the app has permission to show badges. * @returns {Promise<any>} */ Badge.hasPermission = function () { return; }; /** * Register permission to set badge notifications * @returns {Promise<any>} */ Badge.registerPermission = function () { return; }; __decorate([ Cordova() ], Badge, "clear", null); __decorate([ Cordova() ], Badge, "set", null); __decorate([ Cordova() ], Badge, "get", null); __decorate([ Cordova() ], Badge, "increase", null); __decorate([ Cordova() ], Badge, "decrease", null); __decorate([ Cordova() ], Badge, "hasPermission", null); __decorate([ Cordova() ], Badge, "registerPermission", null); Badge = __decorate([ Plugin({ pluginName: 'Badge', plugin: 'cordova-plugin-badge', pluginRef: 'cordova.plugins.notification.badge', repo: 'https://github.com/katzer/cordova-plugin-badge', platforms: ['Android', 'iOS', 'Browser', 'Windows', 'Amazon FireOS', 'Windows Phone 8'] }) ], Badge); return Badge; }()); //# sourceMappingURL=badge.js.map