[firebase_messaging]: Error while generating FCM Token: AbortError: Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker #12611
Labels
Needs Attention
This issue needs maintainer attention.
platform: web
Issues / PRs which are specifically for web.
plugin: messaging
type: bug
Something isn't working
Is there an existing issue for this?
Which plugins are affected?
Messaging
Which platforms are affected?
Web
Description
FCM Token is not registered on first launch of app, and refreshing the page able to get token.
Need to generated FCM Token on the first launch of the app itself. Its works on android, but error is in web app only
Reproducing the issue
firbase-messaging-sw.js
main.dart
index.html
Firebase Core version
2.28.0
Flutter Version
3.19.5
Relevant Log Output
Flutter dependencies
Expand
Flutter dependencies
snippetAdditional context and comments
Seems like its occuring due to race condition. I have browsed the already reported issues, found that
3.5.16
FIX(messaging): fix an issue where Service Worker would not register in time (#11979). (4752efb6)
This issue is been fixed for firebase_messaging_web package, it will be good the same fixed for firebase_messaging too
The text was updated successfully, but these errors were encountered: