@react-native-firebase/messaging getInitialNotification 返回 null

问题描述 投票:0回答:2

package.json

“@react-native-firebase/app”:“^18.3.0”, “@react-native-firebase/messaging”:“^18.3.0”,

应用程序.js

firebase.messaging().getInitialNotification().then(message => {
  console.log(
    'Notification caused app to open from quite state:',
    message,
  );
  if (message != null && message.data) {
    Common.handlePushNavigation(this.props.navigation, { type: message.data.type, target: message.data.target });
  }
});

iOS 中消息为空。 安卓运行良好。

我尝试更改 firebase 版本,但没有成功。

react-native-firebase
2个回答
0
投票

我正在使用 “@notifee/react-native”:“^7.0.4” 用于前台消息传递进程。

这将 iOS 应用程序的外部通知挂接到它自己的进程中。 所以我将该库版本降级为 5.* 并且运行良好。


0
投票

这里有任何更新。我也面临这个问题

© www.soinside.com 2019 - 2024. All rights reserved.