Firebase messaging is not supported in your browser how to solve this?

前端 未结 2 586
清酒与你
清酒与你 2021-01-20 00:40

I am using firebase messaging for web push notification with react. But browser show this message

Messaging: This browser doesn\'t support the API\'s

相关标签:
2条回答
  • 2021-01-20 01:20

    FCM supports only in localhost and the https enabled sites only. if you want FCM to support you need to either work on localhost or deploy somewhere (you can use firebase).

    If you are using proxy using nginx like local.somehost.com cloud messaging doesn't support. To solve this you need to make your local.somehost.com as HTTPS you can install openssl and certificate and key in your nginx.

    I think this solves your problem.

    0 讨论(0)
  • 2021-01-20 01:26

    In addition to the above explanation you can check if the browser supports messaging by doing:

    const messaging = firebase.messaging.isSupported() ? firebase.messaging() : null

    0 讨论(0)
提交回复
热议问题