我正在尝试集成react-native-freshchat-sdk
以响应本机应用程序,但是当 Firebase 远程消息到来时,freshchatNotification 为 0,但它应该为 1。即使我传递notification
给 Freshchat.handlePushNotification 也没有任何反应。我假设 Freshchat.handlePushNotification 应该将用户导航到对话
实际结果
- 如果是 fcm 通知,freshchatNotification 为 0
- Freshchat.handlePushNotification(notification) 什么都不做
预期结果:
- 如果是 fcm 通知,freshchatNotification 应该等于 1
- Freshchat.handlePushNotification(notification) 应该将用户导航到聊天
import messaging from '@react-native-firebase/messaging'
import { Freshchat} from 'react-native-freshchat-sdk'
//...
useEffect(() => {
const unsubscribe = messaging().onMessage(notification => {
Freshchat.isFreshchatNotification(notification, (freshchatNotification) => {
Freshchat.handlePushNotification(notification);
if (freshchatNotification) {
Freshchat.handlePushNotification(notification);
} else {//...}
})
});
return unsubscribe
}, [])