-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Not receiving FCM messages #1904
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
Comments
@BradyShober any resolution here? I am facing the same issue |
I have faced the same issue. After that, I tried this code, it works for me.
then
|
I have the same issue please. How can help me ?? |
I am having the same issue . If I try CURL from Postman , it gives success response but does not store in firebase. If I directly create JSON in firebase database , then also I am not getting PUSH notification |
We have since switched to react-native and are no longer using Angular, but shortly before we switched we realized that the issue we had been experiencing was due to using the firebase console to try to send notifications to web, which does not work, and found when we used the admin sdk we were able to get the notifications. Not sure if that is the same issue for others here having issues getting notifications. |
I have only been using the web client, but have found that the only way that the client will receive messages is if it includes the Notification object. When sending a message with only the Data object it shows it was sent successfully and gives me an ID on return, but the client never receives it. I am hoping to find a solution since I really don't need the Notification functionality. If someone has figured this out, let me know! |
Any updates here? Is this project still maintained? |
I need help too, I can receive the notification in the background, but the onMessage or messages.subscribe (for foreground) is not triggering when receiving notifications. |
Any solution on this one? i have the save issue, it was working on background but for the foreground it doesnt really being triggered. |
Same for me here, working on background but for the foreground doesn't trigger |
Same here, the background works and foreground doesn't. |
@azhararmar @sgallard i have fixed my problem by matching the version of importScript inside the firebase-messaging-sw.js and the version of firebase install in package.json |
@lancelynyrd I fixed the issue by changing the version of importScript from 5.x to 7.x |
@lancelynyrd solution worked for me |
@azhararmar U save my ass. |
If still it doesn't work , Add the PublicVapidKey to _messaging which belong to FireMessaging promise of messaging.service this.angularFireMessaging.messaging.subscribe((_messaging) => { To get key Project Settings->Cloud Messaging |
I guess firebase versions above 7.6.0 are not compatible with @angular/fire 5.3.0 I tried with 7.6.3 and 7.7.0 but I can't get it to work .but it works fine with 7.6.0 |
THIS! I've tried using anything above 7.5.0 but it wouldn't work. |
I'm also having same issue (working great in background not working in foreground)
This is the code of my messaing.service.ts so far:
|
It would be great if Angular Fire would tell exactly which version of firebase to use. |
I indeed fixed it temporarily by using firebase 7.6.0 with angular/fire 5.4.0. 7.8.0 wouldn't work. |
There is workaround for it. You need to modify your custom messaging service little bit. Inside constructor you need to replace following code this.angularFireMessaging.messaging.subscribe( this.angularFireMessaging.messaging.subscribe( Thanks & Regards Rachit V. Sakhidas |
thanks @rachitsakhidas but it did not help. I use postman in order to test push notifications: this is how I push notifications in the test website that I'm currently testing... I have two headers, one of which is the authorization which consists of "key=with the key from the firebase console" another field is Content-Type that is equal to application/json The body (json) of the request is: { "collapse_key" : "type_a", thanks for your help! |
It happens again on firebase 7.9.1 and angularfire 6.0.0-rc.1 |
any update here? same poblem again with firebase7.13.2 |
Testing with firebase 7.14.1 doesn't work neither. I was able to get the foreground notifications following this article but is a workaround really. Here is the final code related with the article but is necessary to install the Angular Service Worker (ngsw) also. Hope the firebase team fix this sooner because get the foreground messages is really important for the package functionality. |
any update? |
I'm having the same issue, with Firebase 7.14.2 and Angular Fire 6.0.0. Any solution? |
Same issue with "firebase": "7.14.4" and "@angular/fire": "6.0.0". Any idea? |
Have You tried to register background notifications listener in worker
service? It works for me
El lun., 18 de mayo de 2020 11:59, Yandy Marrero Morales <
[email protected]> escribió:
… Same issue with "firebase": "7.14.4" and ***@***.***/fire": "6.0.0". Any
idea?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1904 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APA6GSOLBSWYMPATN2FKTC3RSCI7VANCNFSM4FYEO2FQ>
.
|
I have the same issue but its working fine on localhost but in https only working the background notification FIREBASE 7.6.0 |
I finally got this done, Im sure there is a better and proper soluciotion but, based on @rachitsakhidas, and removing worker registration from index file and make it in angular.json it worked for me: "firebase": I did tried others many versions of both and theirs convinations and nothing seem to worked, so i registerd a firebase-messaging-sw.js
I'm working with ionic in this case but maybe, this can save some time to someone. |
Still not working for me @fenrirdrk can you please let me know what you mean by "removing worker registration from index file and make it in angular.json". Also what version of ionic framework you are using Now I'm going to try the version you have suggested. |
As suggested in https://github.com/angular/angularfire/blob/master/docs/ionic/v3.md I have installed angularfire2 using the command npm install angularfire2 firebase promise-polyfill --save Now my version is It seems there is bug in firebase-messaging.js event handler so only we are not receiving the messages. Now I have commented the onMessage and added a listener in service worker, now I'm getting foreground messages to web, Hope this will save others time, as I have spent more than one day trying different approaches and trying different versions. Note: still not receiving the background messages on web. If anyone knows the solution please let me know. |
Use angular 5.4.2 and firebade 7.6.0 it will work
And for production remove the^ of 7.6.0 otherwise it will take the hire
version.
Regards
Karthik
…On Fri, 29 May 2020, 6:33 pm NethajiV, ***@***.***> wrote:
As suggested in
https://github.com/angular/angularfire/blob/master/docs/ionic/v3.md I
have installed angularfire2 using the command
npm install angularfire2 firebase promise-polyfill --save
Now my version is
***@***.***/fire": "^5.4.2",
"angularfire2": "^5.4.2",
"firebase": "^7.14.5",
It seems there is bug in firebase-messaging.js event handler so only we
are not receiving the messages.
[image: image]
<https://user-images.githubusercontent.com/22527863/83262160-1d9d1e00-a1da-11ea-960d-2dc11864c044.png>
Now I have commented the onMessage and added a listener in service worker,
now I'm getting foreground messages to web,
[image: image]
<https://user-images.githubusercontent.com/22527863/83262402-8c7a7700-a1da-11ea-8cb9-892736cb921b.png>
Hope this will save others time, as I have spent more than one day trying
different approaches and trying different versions.
Note: still not receiving the background messages on web. If anyone knows
the solution please let me know.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1904 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEG43POP7AMCGJ52C3KTRQTRT6XAHANCNFSM4FYEO2FQ>
.
|
Higher :)
On Sun, 31 May 2020, 12:23 am Karthik S Kumar, <[email protected]>
wrote:
… Use angular 5.4.2 and firebade 7.6.0 it will work
And for production remove the^ of 7.6.0 otherwise it will take the hire
version.
Regards
Karthik
On Fri, 29 May 2020, 6:33 pm NethajiV, ***@***.***> wrote:
> As suggested in
> https://github.com/angular/angularfire/blob/master/docs/ionic/v3.md I
> have installed angularfire2 using the command
>
> npm install angularfire2 firebase promise-polyfill --save
>
> Now my version is
> ***@***.***/fire": "^5.4.2",
> "angularfire2": "^5.4.2",
> "firebase": "^7.14.5",
>
> It seems there is bug in firebase-messaging.js event handler so only we
> are not receiving the messages.
>
> [image: image]
> <https://user-images.githubusercontent.com/22527863/83262160-1d9d1e00-a1da-11ea-960d-2dc11864c044.png>
>
> Now I have commented the onMessage and added a listener in service
> worker, now I'm getting foreground messages to web,
>
> [image: image]
> <https://user-images.githubusercontent.com/22527863/83262402-8c7a7700-a1da-11ea-8cb9-892736cb921b.png>
>
> Hope this will save others time, as I have spent more than one day trying
> different approaches and trying different versions.
>
> Note: still not receiving the background messages on web. If anyone knows
> the solution please let me know.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#1904 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEG43POP7AMCGJ52C3KTRQTRT6XAHANCNFSM4FYEO2FQ>
> .
>
|
For me the @fenrirdrk solution worked great! Using the same versions and using the event listener: messaging.onMessageCallback = (payload: any) => { Thanks! |
Work for me, Thanks! |
It works for me with version:
|
PR is coming #2497 |
PR is close, since that firebase have new update: version 7.16 of firebase was fix this bug. Please update to the newest version and try this: Remember to update your for who was confuse with |
7.17.1 and the same problem.
|
I m using firebase 7.22.1 version and @angular/fore 5.4.0 i m getting response when call API but not getting Pop-up Notification |
which firebase and @angular/fire versions ? |
For people still having this problem : We have this setup inside an Ionic / Angular app. We use the native cordova FCM plugin for mobile devices, but solely for developing purposes we wanted to have the notifications triggered in web too. Notifications composer in Firebase console does not seem to work with AngularFire in web. We tried instead with a custom .NET testclient, and there it works. So if you are trying with the notifications compose: don't waste your time. I am receiving both foreground and background notification messages with following setup: (make sure you install "@angular/fire": "^6.0.5", "firebase": "8.0.2", ) firebase-messaging-sw.js
app.component.ts (or wherever you want this in your app)
angular.json
|
Things should be much better now, more to work on (out of box support with NGSW) but I we support |
in the new versions use don't need to |
@mafei-dev |
I have tried following the documentation in order to set up browser notifications for the application my team is currently developing. While I am able to obtain an FCM registration token, when I try to send a notification it does not appear to be received by the application. We are using the default firebase-messaging-sw.js
Version info
Ionic 3.9.2
Angular 5.2.10
Firebase ^5.5.1
AngularFire ^5.0.2
Browsers tested: Chrome 69.0.3497.100, Firefox 63.0b10
How to reproduce these conditions
Create a new Ionic project and install required packages.
app.module.ts
fcm.ts provider
notification.ts provider
home.ts
Expected behavior
When a notification is sent we should be seeing a log entry in the console and the notification should open.
Actual behavior
There is no log message and no notification opens.
The text was updated successfully, but these errors were encountered: