Hi,
We are migrating from Cordova to Capacitor.
For a long time, we worked with Cordova FCM plugin for getting push notifications -
It worked great for Android & iOS.
In Capacitor, I saw that there are 2 plugins:
- Push Notifications Plugin - capacitor-plugins/push-notifications at main · ionic-team/capacitor-plugins · GitHub
- FCM Plugin - GitHub - capacitor-community/fcm: Enable Firebase Cloud Messaging for Capacitor apps
I try to use both plugins together as the documentation suggests. I understood that I must use the FCM plugin to get FCM token on iOS and not APNS.
From the FCM plugin:
From the Push Notifications plugin:
Currently I’m only developing and testing the Android, and when I’m using FCM.getToken to get token. Using this token on the BE to send fcm push, returns an error:
“The registration token is not a valid FCM registration token”
If I’m using the token that I get from the Push Plugin: PushNotifications.addListener(‘registration’), it works ok, but I’m not sure that this will be good for iOS FCM token later.
So I’m confused which plugins should I use for FCM on both platforms and why does it fail.
Appreciate you help.
Thanks!