Promise Rejection V4: Getting Unread counts in all channels


I currently I am using V4 but it seems the const count = await sb.groupChannel.getTotalUnreadMessageCount(); and const count = await sb.groupChannel.getTotalUnreadChannelCount(); are not usable requires params but it not stated in V4 documentation.

Hi @qatarzu12,

Welcome to the Sendbird Community.

I did some double checking on this issue and found that I can call getTotalUnreadChannelCount() without any issues as it does not take in any parameters.

However, getTotalUnreadMessageCount() does take in an instance of TotalUnreadMessageCountParams. Which looks like this:

  channelCustomTypesFilter?: string[];
  superChannelFilter?: SuperChannelFilter;

I’ll work to have our documentation corrected.

Thank you! Tyler. For fast reply that would helpful if it is included in docs.


Just a quick note. In addition to the documentation changes, I spoke with our Engineering team and we are going to make the parameters for getTotalUnreadMessageCount() optional rather than mandatory. This way you’re not required to pass in an empty object.

1 Like

Hi Tyler, yes please because now the parameter of channelCustomTypesFilter are required if we set an empty object or [‘’] the unread count is always zero.

1 Like