Chrome 推送通知:本站已在后台更新 [英] Chrome Push Notification: This site has been updated in the background

查看:102
本文介绍了Chrome 推送通知:本站已在后台更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在实施 chrome 推送通知时,我们正在从我们的服务器获取最新的更改.这样做时,service-worker 会显示带有消息的额外通知

While implementing the chrome push notification, we were fetching the latest change from our server. While doing so, the service-worker is showing an extra notification with the message

本站已在后台更新

已尝试使用此处发布的建议https://disqus.com/home/discussion/html5rocks/push_notifications_on_the_open_web/
但直到现在找不到任何有用的东西.有什么建议吗?

Already tried with the suggestion posted here https://disqus.com/home/discussion/html5rocks/push_notifications_on_the_open_web/
But could not find anything useful till now. Is there any suggestion ?

推荐答案

通常,一旦您收到来自 GCM(Google Cloud Messaging)的推送消息,您就必须在浏览器中显示推送通知.此处的第 3 点提到了这一点:

Generally as soon as you receive a push message from GCM (Google Cloud Messaging) you have to show a push notification in the browser. This is mentioned on the 3rd point in here:

https://developers.google.com/web/updates/2015/03/push-notificatons-on-the-open-web#what-are-the-limitations-of-push-messaging-in-chrome-42

因此,尽管您收到了来自 GCM 的推送消息,但您收到的推送通知带有一些默认消息,例如此站点已在后台更新",但您可能会以某种方式跳过推送通知.

So it might happen that somehow you are skipping the push notification though you got a push message from GCM and you are getting a push notification with some default message like "This site has been updated in the background".

这篇关于Chrome 推送通知:本站已在后台更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆