Is firebase_messaging supported in plain Dart (not Flutter) code? #12981
Unanswered
andynewman10
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If I understand correctly, on the web, Firebase messaging requires developers to write a
firebase-messaging-sw.js
file in the web folder. This implementation seems to be required to receive any FCM message, including messages with a notification payload.This file currently needs to be written in plain Javascript code, which is not ideal, eg.:
https://firebase.google.com/docs/cloud-messaging/js/receive#web_1
As stated here, there used to be a firebase package (https://pub.dev/packages/firebase) that was supported by plain Dart code:
This package is now deprecated and developers have long asked to migrate to firebase_core.
Is it possible to write a web service worker in Dart and use Firebase packages?
Beta Was this translation helpful? Give feedback.
All reactions