When I am receiving firebase push notifications in the foreground, by using @angular/fire/messaging
. The method is:
this.angularFireMessaging.
Yes What I have realized that i had using the wrong version of "@angular/fire": "^5.3.0" which is not compatible with "firebase": "^7.6.2", in my package.json.
So, What i have did-
In firebase-messaging-sw.js or the service worker file?
importScripts('https://www.gstatic.com/firebasejs/5.0.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/5.0.0/firebase-messaging.js');
should have the same version with your firebase on package.json
"dependencies": {
...
"firebase": "^5.0.0",
"@angular/fire": "^5.0.0",
...
}
And it is working like a charm.