Firebase Service worker not found while using GWT (404 Error)

前端 未结 4 1241
忘了有多久
忘了有多久 2020-12-01 18:41

I\'d like to use the firebase cloud messaging service in my GWT webapplication, but I\'m stuck with some problems. The application should be able to register the firebase se

4条回答
  •  悲&欢浪女
    2020-12-01 19:24

    The Firebase SDK attempts to register the service worker at a specific location.

    The location is + /firebase-messaging-sw.js. There are two options:

    1.) Make + /firebase-messaging-sw.js work in the browser (i.e. make sure it returns a valid response) and then try using the SDK again (it should work if the browser can access the file).

    2.) Use the useServiceworker() method to pass in a custom service worker. This will still require you to have a valid service worker URL.

提交回复
热议问题