Push notification not getting delivered via service workers Push notification not getting delivered via service workers google-chrome google-chrome

Push notification not getting delivered via service workers


When a user clears their cache in Chrome, it also unregisters service workers and clears the window cache as well. By unregistering the service workers it will unsubscribe the push subscriptions.

I agree that it's hard to understand the link between clearing a cache / cookies and how that relates to service worker and push notifications from the UI - the Chrome team are aware of this.

The best advice with respect to getting those users back is to ensure that when ever a user enables notifications and you get a subscription object, keep track of that decision as their last known decision and when the user re-visits your site, if they should be subscribed and you have permission, you can get a new subscription and send that back to your server.

Update

I put together this blog post: https://gauntface.com/blog/2016/05/01/push-debugging-analytics

Looking at your site there are a few issues in your code:

  • it seems that you have several broken promise chains and and overall it's hard to reason with what is going on in the push event, I'd strongly recommend tidying it up.
  • There is a minor but obvious bug when the service worker start ups and tries to examine the push subscription, which doesn't exist.
  • You are registering two service workers but only one of them gets used for push.

Checkout the blog post above, it covers how I came to that conclusion and some advice on how to fix it.