问题描述
参见标题:如何使用 React Native Firebase Cloud Messaging 实现应用内(前台)横幅通知?
我让它与“警报”模块一起工作,但这会在您的屏幕中间弹出,而我只想要屏幕顶部的横幅,不会干扰用户的操作。
messaging().onMessage(async remoteMessage => {
// Set the matchScreenParentState to 'loading' in case the message 'type' property specifies new match
// Notifications for chats don't trigger anything. That will be just socket.io
if (remoteMessage.data.notificationType==='matchFound') {
setMatchScreenParentState('loading')
Alert.alert('A new match was found!')
}
})
查看文档表明当应用程序处于前台时没有通知但肯定必须以某种方式提供这样的核心功能??? https://rnfirebase.io/messaging/usage#notifications
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)