Skip to main content

Hi,

We are developing a React Native app with Intercom integration using the https://www.npmjs.com/package/@intercom/intercom-react-native package. We want to get the unread message count for a user to show a notification when the app is open and the user receives a new Intercom message.
We have tried using the addEventListener with IntercomEvents.IntercomUnreadCountDidChange but the passed in callback does not get invoked when new messages are received. We also tried calling the getUnreadConversationCount method and that returns the initial count of messages when our app starts and the user is logged in into Intercom, but subsequent calls always returns the initial value event when new messages are received in Intercom. Calling logout and login again in Intercom and then calling getUnreadConversationCount returns an updated count, so it looks like a bug in your code, or are we doing something wrong on our end?

Thank you,
Mikael Amborn

Hey ​@Mai Development 👋 Jacques here from support engineering!

Can you check that you are correctly using the Intercom.getUnreadConversationCount() method to grab the current count. We’d need a bit more insight to your code setup to see if if there is anything that could be causing issues.

If you have confirmed that you are using these methods correctly but the callback is still not being invoked when new messages are received, it could be an issue with the event listener setup. Ensure that your useEffect hook is set up correctly to listen for the IntercomUnreadCountDidChange event and that the listener is being properly removed when the component unmounts.

In case you are using Firebase or another push notification service, it is recommended to let Intercom handle push notifications automatically, as manual handling can sometimes lead to issues with notification badges or unread message counts not updating correctly.

If after checking these points the issue persists, if you haven’t yet try having a look at our official documentation for the React Native Intercom integration for any additional configuration that may be required.

If you can’t spot any issues with your integration, I’d recommend reaching out to our support team so they can gather the information on your setup and write up a bug report for this.

Hope this helps! :)


Reply