Handle expired web push subscriptions

492 views
Skip to first unread message

Zenitsu

unread,
May 27, 2022, 10:53:13 AM5/27/22
to Chromium Extensions

I noticed that the web push subscription expires daily, I'm not sure how to handle the re-subscription since Chrome doesn't support this event https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/pushsubscriptionchange_event


Details:
- a subscription is generated in the service worker and posted to the server, stored in the DB
- sever sends web push, it works
- next day when I try to send web push I get the 410 Gone with message "push subscription has unsubscribed or expired.

What can I do to renew the subscription? it would also be super useful if we could know how much time it is alive and renew it before it expires
Reply all
Reply to author
Forward
0 new messages