且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以在没有通知许可的情况下使用 Firebase 云消息吗?(Javascript)

更新时间:2023-09-10 14:58:34

问题是 Firebase Messaging 只使用一种方法来传递通知.那是 Push API 规范规范,并且该规范(错误且不幸地)不允许服务工作者在没有用户允许 unrelated 权限来显示通知的情况下接收消息.

The problem is that Firebase Messaging is only using 1 method to deliver notifications. That is the Push API specification spec, and that specification (wrongly and unfortunately) does not allow a service worker to receive messages without the user allowing an unrelated permission to show notifications.

解决方法是让 Firebase 消息传递团队提供一种不同的方式来将消息传递到活动网页——长轮询或 websocket.

The fix would be for the Firebase Messaging team to provide a different way to deliver messages to active web pages -- long polling, or websockets.

但这对他们来说是额外的工作,而且可能没有足够的人提出要求.

But it would be extra work for them, and may be not enough people are requesting it.