Open b1tw0rker opened 3 years ago
I was able to fix the situation by listening to the "activate" event instead. The installing event is not good enough and causes the push manager not to be ready for subscription.
Find out why here https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
When Clicking on "Ask Permission". I got these error:
Error DOMException: Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker at http://localhost:3000/service.js:31:66