ReactJS - FCM无法在safari浏览器中运行 [英] ReactJS - FCM not working in safari browser
问题描述
我正在尝试在我的ReactJS应用程序中实现FCM推送通知。
它完全适用于chrome和firefox浏览器,但在safari浏览器中遇到问题。
I am trying to implement FCM push notification in my ReactJS application. It is working in chrome and firefox browser perfectly but facing in an issue in safari browser.
FirebaseError:消息:此浏览器不支持使用firebase SDK所需的API。 (消息/不支持的浏览器)。
FirebaseError: Messaging: This browser doesn't support the API's required to use the firebase SDK. (messaging/unsupported-browser).
我还查看了firebase的文档,发现它只支持3个浏览器。
I also gone through the documentation of firebase also found that it only supports on only 3 browsers.
-
Chrome
Chrome
Firefox
Safari
在safari浏览器中是否有任何方法可以支持同样。
Is there any method to supports in safari browser as well.
推荐答案
Safari 11.1已经支持 serviceWorker
,但它仍然不支持FCM Javascript API也需要 PushAPI
。
Safari 11.1 already supported serviceWorker
, but it still didn't support PushAPI
that is also needed by FCM Javascript API.
取自Firebase文档( https://firebase.google.com/docs/cloud-messaging/js/client ):
Taken from Firebase documentation (https://firebase.google.com/docs/cloud-messaging/js/client) :
FCM JavaScript API允许您在支持Push API的浏览器中运行的Web应用程序中接收通知消息。
The FCM JavaScript API lets you receive notification messages in web apps running in browsers that support the Push API.
这是受支持的br owser list: https://caniuse.com/#feat=push-api Safari仍然不支持Push API
Here is the supported browser list: https://caniuse.com/#feat=push-api that states that Safari still not supporting Push API
这篇关于ReactJS - FCM无法在safari浏览器中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!