11

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 notification on one of those devices/platforms
  • We want to now remotely hide that notification from their other devices/platforms

Given the userVisible restrictions with the Push API, is there any way to achieve this experience?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
owencm
  • 8,384
  • 6
  • 38
  • 54
  • I don't think it's possibile right now, since there is no "on dismiss" event in the Push API – collimarco Mar 25 '16 at 16:32
  • 2
    That event was actually added in Chrome 50: http://blog.chromium.org/2016/03/chrome-50-beta-push-notification.html. There's still no way to send a push message that just dismisses other notifications though, so we're only halfway there... – owencm Mar 26 '16 at 00:26
  • Oh yes we need this :| – REJH Feb 20 '17 at 18:35

1 Answers1

3

To the best of my knowledge this isn't possible, but it is a common feature request.

The main risk you have with sending a push message to hide a notification is that it may trigger a notification to be shown by the browser which has a message along the lines of:

"example.com performs an update in the background"

Matt Gaunt
  • 9,434
  • 3
  • 36
  • 57