How to get the title of the firebase remote notification
Question
Hi, I have a question regarding remote notifications ( firebase ), is there a way to get the notification title and image, etc. I know I can access the notification payload but I can't find anything regarding getting the title and text of the remote notification.
I guess I might not be looking in the correct place, can someone please point me in the right direction?
Hi @aditya3vedi
You can use a data-only notification and pass all data to the localNotification method.
This will allow you to use all features of the local notification.
PushNotification.configure({
// ...
// (required) Called when a remote is received or opened, or local notification is opened
onNotification: function (notification) {
console.log("NOTIFICATION:", notification);
// process the notification
if(!notification.userInteraction) {
PushNotification.localNotification(notification.data);
}
// (required) Called when a remote is received or opened, or local notification is opened
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
// ...
});
Regards
Hey @Dallas62 Thanks for the quick response. For our project, we are using the Firebase console to send remote notifications. And with how much I can find out, I guess it is not possible to send data-only notifications from the console.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.