firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.77k stars 876 forks source link

The onMessage event only receives one message (my website tab is open - 1 url pathname) when FCM push notification. When I use FCM to push an additional notification, onMessage does not receive the message #7913

Open KhanhKitin opened 6 months ago

KhanhKitin commented 6 months ago

Operating System

macOS monterey 12.5.1

Browser Version

Chrome - Version 120.0.6099.129 (Official Build) (arm64)

Firebase SDK Version

10.7.0

Firebase SDK Product:

Messaging

Describe your project's tooling

My project uses firebase cloud messaging to push notifications to the web.

Describe the problem

The onMessage event only receives one message (my website tab is open - 1 url pathname) when FCM push notification. When I use FCM to push an additional notification, onMessage does not receive the message.

Steps and code to reproduce issue

The onMessage event only receives one message (my website tab is open - 1 url pathname) when FCM push notification. When I use FCM to push an additional notification, onMessage does not receive the message.

ThabrezAhmed commented 4 months ago

I’m facing similar issue. Is there any fix for this ?

ThabrezAhmed commented 4 months ago

On app load even we send push notification, Application receives notification and after a while(less than a minute) service worker gets stopped, when we send notification we don’t receive it.