Subscription refresh with Angular's SwPush

Viewed 364

Our product is built with Angular, users SwPush for web push notifications and requires a high degree of reliability in delivering those notifications.

The problem is that push subscriptions may have an expiration time or may get automatically refreshed by the browser as described here: https://www.w3.org/TR/push-api/#subscription-refreshes (Is this even implemented in web browsers yet?)

What we would like to do is: (1) Ensure that old or expired subscriptions are automatically refreshed (either by the browser or through SW code). (2) Post the old and new subscriptions to the server for persistence, so that new notifications are delivered to the new subscription instead of the old one.

I believe both should happen from the service worker since users may not open the app itself for a while. The question is: is either of these possible with Angular's SwPush? If not, are there simple workarounds?

Best wishes,

0 Answers
Related