3

My chrome push notifications work when the browser tab is open but not when it is closed. From what I understand the notification should appear even when the tab is closed.

I have verified that the notifications are allowed for the site

enter image description here

How can I debug why push notifications are not working when the tab is closed?

Btw I am on a mac.

david_adler
  • 9,690
  • 6
  • 57
  • 97

1 Answers1

7

You are confusing two different technologies:

  • using the Notification API alone, as you do, will show the notification only when the page is open
  • in order to show notifications when a website is closed you need to use Service Workers + Push API + Notification API as I described in this answer
collimarco
  • 34,231
  • 36
  • 108
  • 142