3

I am wondering if I can use web push notifications to update a web page without displaying a notification for the user to interact with. Essentially I want to refresh data after an event on the server.

If this is possible, is it still necessary to receive permission from the user to send these push updates?

Marco Castelluccio
  • 10,152
  • 2
  • 33
  • 48
CJ Jessett
  • 39
  • 4

1 Answers1

6

Yes, you can send push messages without showing a notification, but there are limitations on both Firefox and Chrome on the raw number of "invisible" push messages and the rate at which you send them.

You can experiment a bit with the quotas in different browers using the Push Quota ServiceWorker Cookbook example.

Marco Castelluccio
  • 10,152
  • 2
  • 33
  • 48
  • What is the current rate limit for Chrome / Firefox? (I have tried with that demo but it doesn't work on Chrome 59 on macOS) – collimarco Jul 25 '17 at 15:09
  • I guess we need to update the demo to make it work for recent versions of Chrome. I'm not sure what the current rate limit is. – Marco Castelluccio Jul 26 '17 at 10:13
  • From [the paragraph](https://developers.google.com/web/fundamentals/engage-and-retain/push-notifications/subscribing-a-user) "userVisibleOnly Options" looks like that Chrome doesn't support silent push at the moment (or in any case you can't rely on it, since you don't know how many silent pushes you can send) – collimarco Jul 26 '17 at 14:29
  • Yes, you can't rely on it. That's why I wrote the demo, to allow people to get an idea of what the quota could be. – Marco Castelluccio Jul 27 '17 at 14:26