Re: [w3c/push-api] Make PushSubscription.expirationTime mandatory (#302)

@novaknole Absolutely, you need to handle the `pushsubscriptionchange` otherwise you constantly loose subscribers for no reason... browser can replace a subscription at any time (and actually do that, based on our server logs).

If you need inspiration for handling `pushsubscriptionchange` you can look at our service worker here:
https://pushpad.xyz/service-worker.js

Then on your server you simply replace the old subscription with the new one.

> but this means that wherever I have the subscription code in my app (not in service worker), it will return the new subscription if it got changed.

Yes, it will. But in the meantime, if you don't handle the subscription change, the user will stop receiving the notifications (until he visits your website again and subscribes again).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/issues/302#issuecomment-621902517

Received on Thursday, 30 April 2020 14:50:30 UTC