/ SDKs / Unity
SDKs
Chat SDKs Unity v4
Chat SDKs Unity
Chat SDKs
Unity
Version 4

Retrieve number of unread messages in all channels

Copy link

Using the GetTotalUnreadMessageCount() method, you can retrieve the total number of a user's unread messages in all group channels the user has joined.

SbGroupChannelTotalUnreadMessageCountParams unreadMessageCountParams = new SbGroupChannelTotalUnreadMessageCountParams();

SendbirdChat.GroupChannel.GetTotalUnreadMessageCount(unreadMessageCountParams, (inGroupChannelCount, inFeedChannelCount, inError) =>
{
    if (inError != null)
        return; // Handle error.

    // Further actions or processing using inGroupChannelCount and inFeedChannelCount if necessary.
});