Cordova-plugin-fcm vs cordova-plugin-firebase

Hi,

I will start the implementation of push notification services with Firebase in my latest Ionic 3 app. And I am not sure which is better to work with as of today: cordova-plugin-fcm or cordova-plugin-firebase?

What are your recommendations?

Thanks!

1 Like

See: https://angularfirebase.com/lessons/send-push-notifications-in-angular-with-firebase-cloud-messaging/

thanks.
but i need more a comparison between these 2 plugins and which one is better.

I’m wondering the same thing! From the documentation, its seems that the cordiva-plugin-firebase onBackgroundMessage allows you to process data from a notification while the app is in the background. Cordova-plugin-fcn doesn’t seem to let you do that.

I’m currently trying to switch over from fcm to firebase and facing some issues so I can’t confirm that difference.

I managed to switch over to @ionic-native/firebase-messaging and I’m getting push notifications! But onBackground Message is not working as I’d hoped.

this.firebaseMessaging.onBackgroundMessage().subscribe(message => {
               console.log(‘got message in background’,message);
               this.savedChats.push(message);
           })

I’d expect that this would save the data from the notification but no. I can find examples for the cordova onBackgroundMessage but not the ionic wrapper. I can’t imagine there’s a function for onBackgroundMessage but no ability to receive and process background messages. That would be just cruel and unusual.

@Wcjord - I know this is really really old, but did you manage to find a solution ?

I’ve just been checking for missed messages when the app foregrounds.