Questions tagged [web-push]

The Web Push API lets users of your Web app receive push notifications at any time—even in the background; that is, even when your Web app is not currently running in the foreground on the user’s device (or even when the browser on the user’s device is not currently running). It use Service Workers to handle messages sent using common push services, and to allow your Web app to react to the push notifications it receives.

For more information about the Web Push API, see the actual Push API spec and the articles Using the Push API and Push Notifications on the Open Web. The MDN article Using Service Workers is also relevant.

The IETF standards that describe the Web Push protocol and its message encryption scheme are really useful to understand how to build an application server that sends push notifications to clients and how to encrypt push message payloads.

639 questions
11
votes
1 answer

How to remotely dismiss notifications using web push notifications?

I am using push notifications on the web using the new service worker based API and have this use case: User opts in to receive notifications on multiple devices/platforms We send notifications to them on all devices/platforms User dismisses a…
owencm
  • 8,384
  • 6
  • 38
  • 54
10
votes
2 answers

chrome notifications unsubscribe event

Is it possible to catch unsubscribe event ? This is the code im using to subscribe the user to the notifications if ('serviceWorker' in navigator) { navigator.serviceWorker.ready.then(function(reg) { reg.pushManager.subscribe({ …
lior r
  • 2,220
  • 7
  • 43
  • 80
10
votes
0 answers

How to check if a push endpoint is still valid?

I have successfully implemented HTML5 Push Notifications for my site, for news updates and user events. If an endpoint is no longer valid (for whatever reason, but generally because a user revoked permission in their browser) I get a 404 or 410…
MM.
  • 2,653
  • 4
  • 26
  • 36
10
votes
1 answer

GCM registration id in Service Worker in Push Notification for chrome

I am able to send push notification and in service worker i am making a service call i just to want to send GCM registration id with that service call. How to get registration id or subscription id in service worker here is my code…
9
votes
1 answer

Error getting PushManager Subscription - JavaScript

I've got the following code that registers a service worker and asks the user allow notifications. I'm getting an error after the user allows the push notifications where the promise returned by…
Cannon Moyer
  • 3,014
  • 3
  • 31
  • 75
9
votes
2 answers

FCM: Cannot click notification

I'm using the recently release FCM messaging support for push notifications on the chrome. When my app is in the background, I get the notification but nothing happens when I click the notification. How to I specify the URL which should open when…
9
votes
2 answers

How to do feature detection for Web Push?

Is there any easy way to feature detect Web Push API in browsers (Desktop and mobile)
Prashant Agrawal
  • 660
  • 9
  • 24
8
votes
0 answers

How web push protocol works?

Problem I am wondering how webpush protocol works? Does it keep some kind of connection open like WebSocket protocol? Or does it use mechanism similar to polling? Tried According to documentation WebPush uses HTTP 2.0 server push: A simple protocol…
zolty13
  • 1,943
  • 3
  • 17
  • 34
8
votes
2 answers

Angular 7 PWA configure Push Notifications

I'm creating a PWA using angular 7, but I'm struggling with the push notifications. I was following the tutorials as this and this using SWPush and Vapid keypairs. I was able to subscribe and unsubscribe and my server part works as well, but…
8
votes
5 answers

Can we do web push notifications in chrome without using GCM/FCM?

I am trying to do web push notifications in Chrome without using GCM/FCM. Is it possible? I'm not able to find examples on how to use a different push service.
8
votes
1 answer

How to get push message events like click,close,show with firebase cloud messaging

Trying to implement web push notifications using FCM. I am able to receive push message with payload on browser using firebase cloud messaging library. Below is a javascript code snippet.
bijalscm
  • 445
  • 3
  • 5
  • 14
8
votes
2 answers

How can I test pushsubscriptionchange event-handling code?

The pushsubscriptionchange event is fired by the browser when the push notification server wants the client to resubscribe. How can I manually trigger this event for testing?
mjs
  • 63,493
  • 27
  • 91
  • 122
8
votes
2 answers

Web push notifications not showing since Chrome switched to OSX notifications

Since Chrome switched to the native OSX notifications, sometimes the notifications I try to show using web-push and my service worker do not appear. They appear consistently in previous versions of Chrome. Is there anything I'm supposed to have…
owencm
  • 8,384
  • 6
  • 38
  • 54
7
votes
1 answer

Is it safe to use the "p256dh" or "endpoint" keys values of the push notification subscription object as an identifier within the back-end?

When a user create a subscription through the PushManager.subscribe(), given the applicationServerKey (VAPID public key), it creates a valid subscription the contents of which can be sent and stored in the database. The content sent to the database…
ppak10
  • 2,103
  • 3
  • 13
  • 24
7
votes
0 answers

Subscription refresh with Angular's SwPush

Our product is built with Angular, users SwPush for web push notifications and requires a high degree of reliability in delivering those notifications. The problem is that push subscriptions may have an expiration time or may get automatically…
Ahmad Akra
  • 115
  • 1
  • 3
1 2
3
42 43