The IntercomClient allows you to subscribe to specific Intercom events using addEventListener(type, handler) and removeEventListener(type, handler).
Available notification types are found in IntercomClient.Notifications:
UNREAD_CHANGE_NOTIFICATION: Triggered when the unread conversation count changes.WINDOW_DID_HIDE_NOTIFICATION: Triggered when the Intercom window is hidden.WINDOW_DID_SHOW_NOTIFICATION: Triggered when the Intercom window is shown.
import Intercom from 'react-native-intercom';
const onUnreadChange = (count) => {
console.log('Unread count changed:', count);
};
// Subscribe to unread count changes
Intercom.addEventListener(Intercom.Notifications.UNREAD_COUNT, onUnreadChange);
// Unsubscribe later
Intercom.removeEventListener(Intercom.Notifications.UNREAD_COUNT, onUnreadChange);