Skip to content

Commit aa4c3b3

Browse files
mariohmolihadeed
authored andcommitted
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
1 parent 57bbcde commit aa4c3b3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/@ionic-native/plugins/push/index.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,25 @@ export interface AndroidPushOptions {
188188
topics?: string[];
189189
}
190190

191+
export interface BrowserPushOptions {
192+
/**
193+
* Optional. Your GCM API key if you are using VAPID keys.
194+
*/
195+
applicationServerKey?: string;
196+
197+
/**
198+
* URL for the push server you want to use.
199+
* Default: http://push.api.phonegap.com/v1/push Optional.
200+
*/
201+
pushServiceURL?: string;
202+
203+
}
204+
191205
export interface PushOptions {
192206
ios?: IOSPushOptions;
193207
android?: AndroidPushOptions;
194208
windows?: any;
209+
browser?: BrowserPushOptions;
195210
}
196211

197212
export type PushEvent = 'registration' | 'error' | 'notification';
@@ -237,7 +252,10 @@ export type PushEvent = 'registration' | 'error' | 'notification';
237252
* badge: true,
238253
* sound: 'false'
239254
* },
240-
* windows: {}
255+
* windows: {},
256+
* browser: {
257+
* pushServiceURL: 'http://push.api.phonegap.com/v1/push'
258+
* }
241259
* };
242260
*
243261
* const pushObject: PushObject = this.push.init(options);
@@ -257,6 +275,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
257275
* NotificationEventAdditionalData
258276
* IOSPushOptions
259277
* AndroidPushOptions
278+
* BrowserPushOptions
260279
* PushOptions
261280
*/
262281
@Plugin({

0 commit comments

Comments
 (0)