Open jakusb opened 9 months ago
This is a major headache and one which is hard to find the cause or a solution until you stumble on https://github.com/firebase/flutterfire/issues/11678
This should be documented somehow, maybe as interim workaround flutterfire configure
prints a warning when configuring web, if firebase_messaging was added in pubspec.
For flavors when you generate that file: my solution by using IndexedDB and Hive https://github.com/firebase/flutterfire/issues/12146 While the best solution is https://github.com/flutter/flutter/issues/141371
I think this is the official reference to how to create the service worker: https://firebase.google.com/docs/cloud-messaging/flutter/receive#web
Is there an existing feature request for this?
Command
flutterfire configure --include-messaging
Description
Running "flutterfire configure" works like a charm for normal Firebase operations, but is missing out on Cloud Messaging assistance. We now need to still manually and hardcoded introduce our own firebase-messaging-sw.js for web.
Steps to reproduce the behavior: Run "flutterfire configure" Notice web/firebase-messaging-sw.js is not created
Expected behavior web/firebase-messaging-sw.js or any working equivalent should be created, optionally through flag or always
Reasoning
messaging is important component of many apps. Hardcoding should be avoided where possible
Additional context and comments
No response