Skip to content

Commit

Permalink
feat(push): update PushOptions interfaces to match new version (#1908)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this wrapper will work only with `phonegap-plugin-push@2.0.0`
  • Loading branch information
Euler Menezes Junior authored and ihadeed committed Sep 27, 2017
1 parent 1b04ebb commit 34bf136
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/@ionic-native/plugins/push/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down

2 comments on commit 34bf136

@kleeb
Copy link
Contributor

@kleeb kleeb commented on 34bf136 Oct 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that there should be some info which ionic-native package version matches which cordova lib version. Its not always so straightforward which one to use, or whether the upgrade is needed.

@kleeb
Copy link
Contributor

@kleeb kleeb commented on 34bf136 Oct 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, there is info in the changelog:

push: this wrapper will work only with phonegap-plugin-push@2.0.0

Please sign in to comment.