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
Expected result:
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 to Freshchat
useEffect(() => {
const unsubscribe = messaging().onMessage(notification => {
Freshchat.isFreshchatNotification(notification.data, (freshchatNotification) => {
Freshchat.handlePushNotification(notification);
if (freshchatNotification) {
Freshchat.handlePushNotification(notification.data);
} else {//...}
})
});
return unsubscribe
}, [])