On this page
SwPush
class
Subscribe and listen to push notifications from the Service Worker.
class SwPush {
messages: Observable<object>
subscription: Observable<PushSubscription | null>
isEnabled: boolean
requestSubscription(options: {...}): Promise<PushSubscription>
unsubscribe(): Promise<void>
}
Properties
Property | Description |
---|---|
messages: Observable<object> |
Read-only. Emits the payloads of the received push notification messages. |
subscription: Observable<PushSubscription | null> |
Read-only. Emits the currently active PushSubscription associated to the Service Worker registration or |
isEnabled: boolean |
Read-only. True if the Service Worker is enabled (supported by the browser and enabled via |
Methods
requestSubscription()
|
||
---|---|---|
|
options | Type: |
Returns
Promise<PushSubscription>
unsubscribe()
|
---|
|
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/service-worker/SwPush