We have deployed a PWA that takes regularly sends push notifications to users who explicitly granted permission when prompted.
We have noticed that some of our pushes do result in an error that we do not understand. What we could gather is as follows:
the push is actually delivered to the device (we are using GCM)
the handler for the push event is executed in the service worker
but ultimately, when invoking showNotification, the following error is thrown: ”TypeError: No notification permission has been granted for this origin.”
This behaviour happens on a variety of User Agents, all of them being a version of Samsung Internet
The way we prompt the user for permissions is nothing special, we are using PushManager.subscribe() the regular way:
PushManager.subscribe({ userVisibleOnly: true });
Is there anything special that we should be doing in addition to this to avoid this error?
Dear Samsung Internet Dev Rel Team,
We have deployed a PWA that takes regularly sends push notifications to users who explicitly granted permission when prompted.
We have noticed that some of our pushes do result in an error that we do not understand. What we could gather is as follows:
push
event is executed in the service workershowNotification
, the following error is thrown: ”TypeError: No notification permission has been granted for this origin.”The way we prompt the user for permissions is nothing special, we are using
PushManager.subscribe()
the regular way:Is there anything special that we should be doing in addition to this to avoid this error?
Many thanks!