Files
awesome-cordova-plugins/src/@ionic-native/plugins/badge/index.ts
T
Daniel Sogl 328e5de3f3 docs(plugins): added platforms (#1638)
* added platforms

* round 2

* round 3

* Update index.ts
2017-06-02 15:34:18 -04:00

88 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @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 isnt 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';
*
* constructor(private badge: Badge) { }
*
* ...
*
* this.badge.set(10);
* this.badge.increase(1);
* this.badge.clear();
* ```
*/
@Plugin({
pluginName: 'Badge',
plugin: 'cordova-plugin-badge',
pluginRef: 'cordova.plugins.notification.badge',
repo: 'https://github.com/katzer/cordova-plugin-badge',
platforms: ['Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
export class Badge extends IonicNativePlugin {
/**
* Clear the badge of the app icon.
* @returns {Promise<boolean>}
*/
@Cordova()
clear(): Promise<boolean> { return; }
/**
* Set the badge of the app icon.
* @param {number} badgeNumber The new badge number.
* @returns {Promise<any>}
*/
@Cordova()
set(badgeNumber: number): Promise<any> { return; }
/**
* Get the badge of the app icon.
* @returns {Promise<any>}
*/
@Cordova()
get(): Promise<any> { return; }
/**
* Increase the badge number.
* @param {number} increaseBy Count to add to the current badge number
* @returns {Promise<any>}
*/
@Cordova()
increase(increaseBy: number): Promise<any> { return; }
/**
* Decrease the badge number.
* @param {number} decreaseBy Count to subtract from the current badge number
* @returns {Promise<any>}
*/
@Cordova()
decrease(decreaseBy: number): Promise<any> { return; }
/**
* Determine if the app has permission to show badges.
* @returns {Promise<any>}
*/
@Cordova()
hasPermission(): Promise<any> { return; }
/**
* Register permission to set badge notifications
* @returns {Promise<any>}
*/
@Cordova()
registerPermission(): Promise<any> { return; }
}