phonegap-plugin-push: Added missing methods 'subscribe' and 'unsubscibe' (#13496)

* Added missing method definitions 'subscribe' and 'unsubscibe' for the phonegap-plugin-push

* Corrected indentation of added lines

* Changed errorCallbacks paramaters from optional to required ones; Added additional param description
This commit is contained in:
RayComBomber
2016-12-28 02:04:15 +01:00
committed by Andy
parent 4898b6ebba
commit 2a6e1c6be2

View File

@@ -55,7 +55,24 @@ declare namespace PhonegapPluginPush {
* @param topics
*/
unregister(successHandler: () => any, errorHandler?: () => any, topics?: string[]): void
/**
* The subscribe method is used when the application wants to subscribe a new topic to receive push notifications.
* @param topic Topic to subscribe to.
* @param successHandler Is called when the api successfully unregisters.
* @param errorHandler Is called when the api encounters an error while unregistering.
*/
subscribe(topic: string, successHandler: () => any, errorHandler: () => any): void;
/**
* The unsubscribe method is used when the application no longer wants to receive push notifications
* from a specific topic but continue to receive other push messages.
* @param topic Topic to unsubscribe from.
* @param successHandler Is called when the api successfully unregisters.
* @param errorHandler Is called when the api encounters an error while unregistering.
*/
unsubscribe(topic: string, successHandler: () => any, errorHandler: () => any): void;
/*TODO according to js source code, "errorHandler" is optional, but is "count" also optional? I can't read objetive-C code (can anyone at all? I wonder...)*/
/**
* Set the badge count visible when the app is not running
@@ -68,6 +85,7 @@ declare namespace PhonegapPluginPush {
* @param count
*/
setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count: number): void
/**
* Get the current badge count visible when the app is not running
* successHandler gets called with an integer which is the current badge count