Integrating Push API Persistence

104 Views Asked by At

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 ?

1

There are 1 best solutions below

1
collimarco On

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