From 8c021bcaa04b39950132ef29afb802f71ac1fc49 Mon Sep 17 00:00:00 2001 From: guille Date: Sun, 22 Jan 2017 04:04:34 +0100 Subject: [PATCH 1/3] fix(): add clearAllNotifications() --- src/plugins/push.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugins/push.ts b/src/plugins/push.ts index a947de12d..519506acf 100644 --- a/src/plugins/push.ts +++ b/src/plugins/push.ts @@ -110,6 +110,8 @@ export interface PushNotification { unregister(successHandler: () => any, errorHandler?: () => any): void; /** + * iOS & android only + * * Set the badge count visible when the app is not running * * The count is an integer indicating what number should show up in the badge. @@ -121,6 +123,8 @@ export interface PushNotification { */ setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count?: number): void; /** + * iOS only + * * Get the current badge count visible when the app is not running * successHandler gets called with an integer which is the current badge count * @param successHandler @@ -130,6 +134,7 @@ export interface PushNotification { /** * iOS only + * * Tells the OS that you are done processing a background push notification. * successHandler gets called when background push processing is successfully completed. * @param successHandler @@ -137,6 +142,16 @@ export interface PushNotification { * @param id */ finish(successHandler: () => any, errorHandler: () => any, id?: string): void; + + /** + * iOS & android only + * + * Tells the OS to clear all notifications from the Notification Center. + * successHandler gets called when the api successfully clears the notifications + * @param successHandler + * @param errorHandler + */ + clearAllNotifications(successHandler: () => any, errorHandler: () => any): void; } export interface IOSPushOptions { From 94025a7fd27266758d1e6109869a99d1e1a58113 Mon Sep 17 00:00:00 2001 From: guille Date: Sun, 22 Jan 2017 04:25:12 +0100 Subject: [PATCH 2/3] fix(plugin): adds subscribe() and unsubscribe() --- src/plugins/push.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/plugins/push.ts b/src/plugins/push.ts index 519506acf..ae1c24507 100644 --- a/src/plugins/push.ts +++ b/src/plugins/push.ts @@ -109,6 +109,23 @@ export interface PushNotification { */ unregister(successHandler: () => any, errorHandler?: () => any): void; + /** + * The subscribe method is used when the application wants to subscribe a new topic to receive push notifications. + * @param {string} topic: Topic to subscribe to. + * @param successHandler + * @param errorHandler + */ + 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 {string} topic: Topic to subscribe to. + * @param successHandler + * @param errorHandler + */ + unsubscribe(topic: string, successHandler: () => any, errorHandler?: () => any): void; + /** * iOS & android only * From 77ab2c21da8cf2f95844fa03227d73f4c2dbbdd0 Mon Sep 17 00:00:00 2001 From: Guille Date: Sun, 22 Jan 2017 23:13:42 +0100 Subject: [PATCH 3/3] refractor(): name to pluginName (#994) --- src/plugins/headercolor.ts | 2 +- src/plugins/native-geocoder.ts | 2 +- src/plugins/navigationbar.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/headercolor.ts b/src/plugins/headercolor.ts index c03302839..cab28a872 100644 --- a/src/plugins/headercolor.ts +++ b/src/plugins/headercolor.ts @@ -13,7 +13,7 @@ import { Plugin, Cordova } from './plugin'; * ``` */ @Plugin({ - name: 'HeaderColor', + pluginName: 'HeaderColor', plugin: 'cordova-plugin-headercolor', pluginRef: 'plugins.headerColor', repo: 'https://github.com/tomloprod/cordova-plugin-headercolor', diff --git a/src/plugins/native-geocoder.ts b/src/plugins/native-geocoder.ts index f7bc1d6a3..4fa804d33 100644 --- a/src/plugins/native-geocoder.ts +++ b/src/plugins/native-geocoder.ts @@ -23,7 +23,7 @@ import { Plugin, Cordova } from './plugin'; * NativeGeocoderForwardResult */ @Plugin({ - name: 'NativeGeocoder', + pluginName: 'NativeGeocoder', plugin: 'cordova-plugin-nativegeocoder', pluginRef: 'nativegeocoder', repo: 'https://github.com/sebastianbaar/cordova-plugin-nativegeocoder', diff --git a/src/plugins/navigationbar.ts b/src/plugins/navigationbar.ts index e4b233d18..302fc1e8c 100644 --- a/src/plugins/navigationbar.ts +++ b/src/plugins/navigationbar.ts @@ -16,7 +16,7 @@ import { Cordova, Plugin } from './plugin'; * ``` */ @Plugin({ - name: 'NavigationBar', + pluginName: 'NavigationBar', plugin: 'cordova-plugin-navigationbar', pluginRef: 'navigationbar', repo: 'https://github.com/cranberrygame/cordova-plugin-navigationbar',