I’m using FirebasePlugin with Ionic in order to receive both “data message” and “notifications messages” because i need some notifications are managed by user and other only by app. I have followed firebase documentation to create the content of both types of notifications (https://firebase.google.com/docs/cloud-messaging/concept-options?hl=es-419) This is the expected behaviour:
- App foreground
Data messages - received and managed by app
Notification messages - received and managed by app - App background
Data messages - received and managed by app
Notification messages - received and managed by user (push has to be shown in phone action bar)
This is the code where i’m tryint to receive the push notifications acording with FirebasePluggin doc:
FirebasePlugin.onNotificationOpen(notification => {
});
The issue is i’m not receiving “data messages”. Any idea about how to receive de “data messages” with this pluggin?
-Addtional info - according to firebase doc these are the two types of notifications:
DATA MESSAGES
{
“to” : “bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1…”,
“data” : {
“fieldOne” : “content”,
“fieldTwo” : “content”
},
}
NOTIFICATION MESSAGES
{
“to” : “bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1…”,
“notification” : {
“fieldOne” : “content”,
“fieldTwo” : “content”
}
}