-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Unhandled Promise rejection: this._next is not a function : Zone in @angular/fire/messaging #2299
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
FirebaseExtended/angularfire#943 Its an open PR to angularfire Solution could be:
|
I have the same problem |
I have the same problem too. @dineshrawat11 it doesn't look the PR would fix it. I'm using [email protected] at this moment. Is there anybody working on this? If not, I can take a look at this. |
I'm problem too |
I had this problem and solved it after reading the comments on this issue: #1904
|
Thanks, it works now( I used 7.6.0) |
I Fix it with this easy solution. You can import directly firebase inside an Angular Typescript component, and then set directly onMessage Method like Plain Javascript.
Note: None of Angular Observable solutions worked for me on the foreground messages. |
I am facing the same issue.. is there a fix for this issue? |
Found this workaround for now:
|
this worked for me: this.angularFireMessaging.messaging.subscribe(
(messaging: any) => {
messaging.onMessageCallback = (payload: any) => {
console.log(payload);
};
}
); |
None of the above solutions working for me 😢 If I downgrade the event is firing. |
I also encountered this issue, in the end it turned out the reason for it was that I was using the legacy API for sending the messages (or I was using it wrong). When sending a test message via the FB console, it worked in the background and foreground. While with the legacy API I could receive messages in the background but had this error when the application was in the foreground. |
this worked for me:
|
AngularFire public 6 doesn't have the angularFireMessaging.messaging Observable. |
FYI, the only solution working for me on Angular 9.1.4 (both with promises and Observables) is the one suggested by @vincepunkrock above (i.e firebase 7.6.0 and @angular/fire 5.4.0) Btw! Make sure that you also use the right firebase version inside
|
I had this problem and I solved to do this: in your firebase-messaging-sw.js add these lines: ` ... //firebase config const messaging = firebase.messaging(); messaging.onTokenRefresh = messaging.onTokenRefresh.bind(messaging); //<--this and your subscribe: `import { AngularFireMessaging } from '@angular/fire/messaging' constructor( ... showBrowserMessages() { I am using these versions: |
Seems like an FCM issue for v > 7.6.0. Supposedly, FCM offer rxjs compatibility out of box. Specifically, you could do
However it seem to be not working as intended as I get the same error in my test app. |
PR here #2497, I'm little busy, so hope someone can test |
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 |
When I am receiving firebase push notifications in the foreground, by using
@angular/fire/messaging
. The method is:Let me share my complete code: PushNotificationsService Code I have written.
My Angular-cli versions:
Let me share my package.json files: package.json
I am getting the below error when I receive message in the foreground:
Any help is highly appreciable! CODE: GITHUB REPO LINK
I have update my secret key from firebase in the GitHub code
The text was updated successfully, but these errors were encountered: