从 firebase 推送通知中获取键和值
Get key and value from firebase push notification
我有一个反应本机应用程序 (android) 来接收来自 firebase 控制台的推送通知。
react-native-firebase 中有没有函数可以从推送通知消息中获取键和值(自定义数据)?
在您的通知侦听器中尝试从 data
对象
中提取您的自定义 keys/values
const { data } = notificationOpen.notification;
alert(data.myKey);
我有一个反应本机应用程序 (android) 来接收来自 firebase 控制台的推送通知。
react-native-firebase 中有没有函数可以从推送通知消息中获取键和值(自定义数据)?
在您的通知侦听器中尝试从 data
对象
const { data } = notificationOpen.notification;
alert(data.myKey);