Skip to content

[messaging] using navigator serviceWorker - #2497

Closed
hiepxanh wants to merge 2 commits into
angular:masterfrom
hiepxanh:patch-4
Closed

hiepxanh wants to merge 2 commits into
angular:masterfrom
hiepxanh:patch-4

Conversation

@hiepxanh

@hiepxanh hiepxanh commented Jun 13, 2020 •

Copy link
Copy Markdown
Contributor

Checklist

base on this solution #1904 (comment)

Description

fixing a bug because this.angularFireMessaging.messages not trigger new message any more

Code sample

nothing changes

Update new message source from serviceWorker instead of messaging observable
@hiepxanh

Copy link
Copy Markdown
Contributor Author

@yasinkocak I just push new code, that pass the Javis Test

@jamesdaniels jamesdaniels left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, this should help. Approved. I'll play around with this a bit and then merge.

@jamesdaniels

Copy link
Copy Markdown
Contributor

It also seems a fix is coming upstream firebase/firebase-js-sdk#3221

@hiepxanh

Copy link
Copy Markdown
Contributor Author

perfect, I will update my PR once they complete that change @jamesdaniels

@khaledwalid

khaledwalid commented Jun 25, 2020 •

Copy link
Copy Markdown

@hiepxanh , can you Told me the right version of @angular/fire and firebasejs from gstatic because i have also the issue that when i'm not receiving an notification

@hiepxanh

Copy link
Copy Markdown
Contributor Author

"firebase": "^7.14.5", and "@angular/fire": "^6.0.0", sir @khaledwalid

@hiepxanh

Copy link
Copy Markdown
Contributor Author

it is imposible to fix this, some how big problem come from firebase-messaging-sw.js
image
some how my browser not update new version, so I try everything I can but still cannot receive notification in forground. Even update the latest @angular/fire or firebase (newest version with fix is Fix FCM rxjs Incompatibility
)

@hiepxanh

Copy link
Copy Markdown
Contributor Author

After research, the last firebase version auto add the firebase-messsaging-sw.js file for me. But when I update the firebase in package.json the firebase-messsaging-sw.js is just not update automaticly with the new version. Solution:
I have to create my own firebase-messaging-sw.js that matching to current firebase version:
image

@hiepxanh

Copy link
Copy Markdown
Contributor Author

Close since firebase release new version that fix this bug, I think we need to update the document, because I have serious trouble, the message in foreground is not fired if you have missmatch firebase version in firebase-messaging-sw.js

@hiepxanh hiepxanh closed this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants