0

I'm trying to integrate persistent push notification with Push API in a PWA, i saw in the docs that it's possible to do that but i can't see any example or what so ever to do that, is there a tutorial that can help me achieve that ?

Garsivirus
  • 97
  • 1
  • 9

1 Answers1

1

You need to set the requireInteraction flag in order to make a notification persistent (i.e. do not hide it after a few seconds automatically).

Currently this flag is supported only by some browsers.

Here you can find more information:

https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification

collimarco
  • 34,231
  • 36
  • 108
  • 142
  • @Garsivirus Persistent notifications are not supported yet by Chrome mobile... but that is probably a choice. Maybe you can report your feature request here: https://www.chromium.org/for-testers/bug-reporting-guidelines – collimarco Oct 28 '20 at 10:55