React Native Firebase OnNotificationOpen无法访问数据有效负载
在React Native中使用Google Firebase通知,我无法访问NotificationOpen上的数据有效负载 下面是一个例子React Native Firebase OnNotificationOpen无法访问数据有效负载,firebase,react-native,firebase-cloud-messaging,Firebase,React Native,Firebase Cloud Messaging,在React Native中使用Google Firebase通知,我无法访问NotificationOpen上的数据有效负载 下面是一个例子 this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => { const { title, body } = notificationOpen.notification; console.log(
this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => {
const { title, body } = notificationOpen.notification;
console.log(JSON.stringify(notificationOpen.data)) // {}
});
notificationOpen.notification.data未定义
我正在以以下格式触发API
{
"to": <dev_token>,
"notification":{
"title":"Portugal vs. Denmark",
"body":"great match!"
},
"data" : {
"Nick" : "Mario",
"Room" : "PortugalVSDenmark"
}
}
{
“致”:,
“通知”:{
“头衔”:“葡萄牙对丹麦”,
“身体”:“伟大的比赛!”
},
“数据”:{
“尼克”:“马里奥”,
“房间”:“葡萄牙公园”
}
}
使用react本机firebase:“5.5.6”
提前谢谢