处理Chrome中过期的Web推送订阅
我注意到Web推送订阅每天到期,我不确定如何处理重新订阅,因为Chrome不支持此事件
>
- https://develover.mozilla.org.org/en-us/docs/docs/web/web/api/service/servicework-服务工作者并张贴在服务器上,存储在DB
- Sever中,发送Web推动,
- 第二天我尝试发送Web推动时,它可以使410消失,并带有消息“推送订阅未订阅或过期”。
如果我们知道订阅的寿命并在它到期之前续订它,那将非常有用,我没有找到与该
注释有关的任何内容:我正在使用此gem https://github.com/zaru/webpush 从服务器塞发送Web推动
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 a web push I get the 410 Gone with the message "push subscription has unsubscribed or expired."
it would be super useful if we could know the lifespan of a subscription and renew it before it expires, I didn't find anything related to that
note: I'm using this gem https://github.com/zaru/webpush to send web push from the server-side
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论