Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React Native Firebase OnNotificationOpen无法访问数据有效负载_Firebase_React Native_Firebase Cloud Messaging - Fatal编程技术网

React Native Firebase OnNotificationOpen无法访问数据有效负载

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(

在React Native中使用Google Firebase通知,我无法访问NotificationOpen上的数据有效负载

下面是一个例子

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”

提前谢谢