Messaging: We are unable to register the default service worker error, firebase-messaging-sw.js, but I did not create any #5514
-
|
I have a simple Flutter app, which uses FlutterFire Firestore and Functions, Messaging. The android bundle works without any errors, but the web client gives me quite a headache. Initially I have stumbled upon this issue: #4837 Now I face a different problem: upon starting the web app, I receive the following error: The app seems to be working, but calling I did not create this firebase-messaging-sw.js, nor do I find any tutorial for creating this in https://firebase.flutter.dev/docs/messaging/overview/#5-web-only-add-the-sdk Any ideas what can be wrong? Flutter doctor: Pubspec.yaml: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I have found a working StackOverflow guide, it seems that I need to register a default service worker. As there were no mentions about this in the documentation, I created an issue about it there: #5515 |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Please take a look at https://firebase.flutter.dev/docs/messaging/usage#handling-messages for documentation. You have to provide a vapidKey when getToken is called through flutter web. This issue can be closed. |
Beta Was this translation helpful? Give feedback.
Hi, Please take a look at https://firebase.flutter.dev/docs/messaging/usage#handling-messages for documentation.
You have to provide a vapidKey when getToken is called through flutter web.
The
firebase-service-worker.jsin not needed unless you want to receive notifications in the background.This issue can be closed.