firebase - firebase.notifications().getInitialNotification() 在 iOS 中返回 null
问题描述
我有一个 React Native 项目并且我正在使用 Firebase,因此react-native-firebase
在我的项目中使用 npm 包来处理推送通知。我按照这里的文档。到目前为止,一切似乎都很好,除了在 iOSgetInitialNotification()
中不断给我的功能。null
因此,我无法检查应用程序是否通过通知点击打开。不过,一切都像 Android 中的魅力一样。
有什么建议么?
async componentDidMount() {
const notificationOpen: NotificationOpen = await firebase.notifications().getInitialNotification();
console.log(notificationOpen); // Outputs null
}
解决了
我通过使用最新的 react-native (0.59.9 > 0.60.5) 和 react-native-firebase (5.5.4 > 5.5.6) 版本解决了这个问题。
解决方案
推荐阅读
- android - 是否可以链接 WorkManager 定期工作人员?
- algorithm - 算法 - 要获得“令人印象深刻”的数字集,您必须进行多少更改
- java - 模式和匹配器java问题,最后一个元素为空
- c++ - 定位/修复函数显示分布中的错误
- android - 如何从网站深度链接到安卓应用程序
- php - PHP trim() 在未指定时删除 S
- azure - 无法将 Azure 数据工厂配置为从 http 端点获取数据
- swift - 类型擦除用于更复杂的协议
- ios - ios PDFKit 模糊pdf
- javascript - 使用 FusionTables JSON 作为 Chart.js 的输入