Ad

Get Key And Value From Firebase Push Notification

I have an react-native App (android) to receive push notification from firebase console.

from firebase console

Is there any function in react-native-firebase can get key and value (custom data) from push notification message?

Ad

Answer

Inside your notification listener try to extract your custom keys/values from the data object

const { data } = notificationOpen.notification;
alert(data.myKey);
Ad
source: stackoverflow.com
Ad