Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: generate or support web/firebase-messaging-sw.js #215

Open
1 task done
jakusb opened this issue Sep 14, 2023 · 3 comments
Open
1 task done

request: generate or support web/firebase-messaging-sw.js #215

jakusb opened this issue Sep 14, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@jakusb
Copy link

jakusb commented Sep 14, 2023

Is there an existing feature request for this?

  • I have searched the existing issues.

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

@fourman-alex
Copy link

fourman-alex commented Feb 1, 2024

This is a major headache and one which is hard to find the cause or a solution until you stumble on firebase/flutterfire#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.

@amrgetment
Copy link

amrgetment commented Feb 1, 2024

For flavors when you generate that file:
my solution by using IndexedDB and Hive
firebase/flutterfire#12146
While the best solution is
flutter/flutter#141371

@JayceeZ
Copy link

JayceeZ commented Mar 25, 2024

I think this is the official reference to how to create the service worker:
https://firebase.google.com/docs/cloud-messaging/flutter/receive#web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants