Get Unread Count via Hook
Feature
It would be great to have the ability to get the unread count via the hook.
const { unreadCount } = useIntercom();
The primary driver behind the request is getting the notification count in a location that is not easy to get from the provider.
I handled this for now using my own context provider but it seems like the library could do this internally pretty easily.
Hi, thanks for the feature request.
We could possibly integrate this, however, this would mean that we deviate from the "1on1" IntercomJS API mapping. (I'm aware that we deviated from this "1on1" mapping in the past)
Anyway, how did you handle this in your own context provider?
I have a global context that I bind events on the IntercomProvider to.
onUnreadCountChange={setNotificationCount}
I can appreciate the sentiment of wanting to be 1:1 - This doesn't change the API - it just provides easier access.
I have a global context that I bind events on the IntercomProvider to.
onUnreadCountChange={setNotificationCount}
I see, but this will result in being undefined until the event is triggered?
I can appreciate the sentiment of wanting to be 1:1 - This doesn't change the API - it just provides easier access.
Indeed. However, most of the time I can refer to official Intercom docs/fora to resolve an issue, which saves quite some time. Introducing some new functionality/extending the API is a bit more heavy lifting in the sense of answering the issues