FCM Problem After Ionic 5 & Angular 9 Update

Recently i upgraded my Ionic 4 project to Ionic 5 and Angular 9. I updated all other packages also. Then some feedbacks reported about notification problems. I noticed that:

When i install app first time, it wants permission for notifications and that time this code works:

token = await this.firebase.getToken();

But works only once. After login or reopen app this code never works.

Not only this code, other FCM codes does not work either:

this.firebase.onMessageReceived();

So i can not get notifications either. (I tried with non-user specific token that i got at first install)

First i suspected about FirebaseX. So i tried last version (9.1.1-cli) then my old version (7.0.1) and nothing changed. Now i use 8.0.1.

1 Like

Well, it’s solved. My mistake. It was about @ionic-native/firebase-x:

When i uninstall and reinstall Cordova FirebaseX, i didn’t touch @ionic-native/firebase-x. This time i uninstalled both of them then installed them in order like docs and it worked:

ionic cordova plugin add cordova-plugin-firebasex
npm install @ionic-native/firebase-x
2 Likes