From 34bf13670337431e51130bd06a3754fc205b42d9 Mon Sep 17 00:00:00 2001 From: Euler Menezes Junior Date: Wed, 27 Sep 2017 18:56:43 -0300 Subject: [PATCH] feat(push): update PushOptions interfaces to match new version (#1908) BREAKING CHANGE: this wrapper will work only with `phonegap-plugin-push@2.0.0` --- src/@ionic-native/plugins/push/index.ts | 30 +++++++++++-------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/@ionic-native/plugins/push/index.ts b/src/@ionic-native/plugins/push/index.ts index 758e276a..afef7c49 100644 --- a/src/@ionic-native/plugins/push/index.ts +++ b/src/@ionic-native/plugins/push/index.ts @@ -62,16 +62,10 @@ export interface NotificationEventAdditionalData { } export interface IOSPushOptions { - /** - * Maps to the project number in the Google Developer Console. Setting this - * uses GCM for notifications instead of native. - */ - senderID?: string; - /** * Whether to use prod or sandbox GCM setting. */ - gcmSandbox?: boolean | string; + fcmSandbox?: boolean | string; /** * If true the device shows an alert on receipt of notification. @@ -137,11 +131,6 @@ export interface CategoryActionData { } export interface AndroidPushOptions { - /** - * Maps to the project number in the Google Developer Console. - */ - senderID: string; - /** * The name of a drawable resource to use as the small-icon. The name should * not include the extension. @@ -186,6 +175,16 @@ export interface AndroidPushOptions { * subscribe to a GcmPubSub topic. */ topics?: string[]; + + /** + * The key to search for text of notification. + */ + messageKey?: string; + + /** + * The key to search for title of notification. + */ + titleKey?: string; } export interface BrowserPushOptions { @@ -244,9 +243,7 @@ export type PushEvent = 'registration' | 'error' | 'notification'; * // to initialize push notifications * * const options: PushOptions = { - * android: { - * senderID: '12345679' - * }, + * android: {}, * ios: { * alert: 'true', * badge: true, @@ -283,8 +280,7 @@ export type PushEvent = 'registration' | 'error' | 'notification'; plugin: 'phonegap-plugin-push', pluginRef: 'PushNotification', repo: 'https://github.com/phonegap/phonegap-plugin-push', - install: 'ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX', - installVariables: ['SENDER_ID'], + install: 'ionic cordova plugin add phonegap-plugin-push', platforms: ['Android', 'Browser', 'iOS', 'Windows'] }) @Injectable()