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?
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.