I'm trying to integrate react-native-freshchat-sdk
to react native app, but when firebase remote message is coming, freshchatNotification is 0, but it should be 1. Even if I pass notification
to Freshchat.handlePushNotification nothing happens. I assume Freshchat.handlePushNotification should navigate the user to the conversation
Actual result
- freshchatNotification is 0 if it is fcm notification
- Freshchat.handlePushNotification(notification) does nothing
Expected result:
- freshchatNotification should be equal 1 if it is fcm notification
- Freshchat.handlePushNotification(notification) should navigate the user to the chat
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
}, [])
Faced similar issue, worked by passing
notification.data
instead of direct notification object toFreshchat