feat(push): add Browser Push notification support (#1848)

* Browser Push interface with options to use push notification with browsers , as a proxy to phonegap-plush-plugin

* making both properties optional
This commit is contained in:
Mario Mol 2017-08-23 20:38:04 -03:00 committed by Ibby Hadeed
parent 57bbcdebfb
commit aa4c3b3787

View File

@ -188,10 +188,25 @@ export interface AndroidPushOptions {
topics?: string[]; topics?: string[];
} }
export interface BrowserPushOptions {
/**
* Optional. Your GCM API key if you are using VAPID keys.
*/
applicationServerKey?: string;
/**
* URL for the push server you want to use.
* Default: http://push.api.phonegap.com/v1/push Optional.
*/
pushServiceURL?: string;
}
export interface PushOptions { export interface PushOptions {
ios?: IOSPushOptions; ios?: IOSPushOptions;
android?: AndroidPushOptions; android?: AndroidPushOptions;
windows?: any; windows?: any;
browser?: BrowserPushOptions;
} }
export type PushEvent = 'registration' | 'error' | 'notification'; export type PushEvent = 'registration' | 'error' | 'notification';
@ -237,7 +252,10 @@ export type PushEvent = 'registration' | 'error' | 'notification';
* badge: true, * badge: true,
* sound: 'false' * sound: 'false'
* }, * },
* windows: {} * windows: {},
* browser: {
* pushServiceURL: 'http://push.api.phonegap.com/v1/push'
* }
* }; * };
* *
* const pushObject: PushObject = this.push.init(options); * const pushObject: PushObject = this.push.init(options);
@ -257,6 +275,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
* NotificationEventAdditionalData * NotificationEventAdditionalData
* IOSPushOptions * IOSPushOptions
* AndroidPushOptions * AndroidPushOptions
* BrowserPushOptions
* PushOptions * PushOptions
*/ */
@Plugin({ @Plugin({