-
Notifications
You must be signed in to change notification settings - Fork 893
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
FCM Messaging breaks in version 7.0.0 or after #2590
Comments
Thanks for reporting the issue, @basvandenheuvel. I can't seem to replicate it.
|
Hi @rommelpe , thanks for your reply.
|
Sorry for the confusion, @basvandenheuvel. It's an intended behavior. If the page is open and focused, you will not see a notification and as a result, you'll receive a callback in onMessage in the page. If the page is in the background (i.e. not focused) the background message handler will be called and will show a notification. See here:
|
I think i introduced the confusion. It is indeed the onMessage callback that is not triggered when the website has focus. The same problem occurs when i connect our environment with the quickstart... The process that should trigger in background does work... |
I'm facing the same problem after upgrading from @basvandenheuvel did you find any solution? @rommelpe i think this issue needs to be reopened. Just checked |
@GoktuqCan not yet.... It looks like for me any version of 7.x.x is broken. I doubt it is my firebase environment since the changelog is straightforward and we followed it. However, why else would their quickstart onMessage not work if i connect it to our environment... |
@basvandenheuvel try |
Just tried again to make the quickstart work for me, no luck with eitehr 7.6.2 or 7.8.0. I added the firebase config of my environment, i host the index.html and see a token being generated for me. I go to the firebase console page of messaging and send a test message. Focus -> Nothing happens, i don't even see the console.log inside my onMessage |
@basvandenheuvel Are you just editing package.json or using the |
Thanks for getting back and continuing on working the issue, @basvandenheuvel @GoktuqCan. I was able to reproduce it using quickstart. It looks like the issue was introduced in v7.7.0. @hsubox76 |
There was a large refactor of the messaging codebase between 7.6.2 and 7.7.0. One of the changes may have impacted this. I'll try to dig into it. PR for my reference: #2484 |
Please make sure that your service worker is actually updated. You can force this by clearing site data in Chrome. Go to DevTools -> Application tab -> "Clear storage" from the menu on the left -> Clear site data.
|
Thanks, @mmermerkaya. I was able to get rid of the issue after updating Closing this issue. Should you have any other questions/clarifications, leave a comment and we're happy to look into it. |
@rommelpe sorry but problem still remains. |
@GoktuqCan Here's a sample response on my end after updating You may want to check third party extension(s) on your browser that might be blocking the response. If nothing works after upgrading & clearing the browser's storage, the last resort would be reinstalling your browser. |
@rommelpe i added a new user to chrome. New user is clean browser and it works for that one. |
@GoktuqCan your users should get the updated service worker eventually. Browsers check for updates automatically after navigations and functional events such as push and sync. |
@Feiyang1 Problem is not about receiving, it is about updating from previous version. Even if i hard reload page and clear cache, updating from |
@GoktuqCan I believe your issue is that the installed sw which references Once it is merged, can you try installing the canary build to verify if it fixes your issue? Thanks! |
@Feiyang1 yes i can check. |
@GoktuqCan The fix is in canary build. Can you please do |
@Feiyang1 canary version seems working now. In service worker canary version throw exception Working versions are:
Thanks for the help i guess fix will come with |
Awesome! thanks for confirming. |
Problem
Currently we are using Firebase SDK 6.5.0. Whenever we update to version 7.0.0 or later (we tried multiple versions including 7.0.0 and 7.8.0) Messaging stops working.
It looks like the background messaging keeps working when the website does not have focus. However when the website does have focus the FCM messaging does not work.
Ofcourse we followed the changelog and enabled the FCM Messaging API.
Relevant Code:
The following code is used in version 6.5.0 and works fine, but breaks in 7.0.0 or after:
The text was updated successfully, but these errors were encountered: