/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
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.

KotlinKTX
val params = GroupChannelTotalUnreadMessageCountParams().apply {
    superChannelFilter = CHANNEL_TYPE_FILTER
    channelCustomTypes = CUSTOM_TYPE
}
SendbirdChat.getTotalUnreadMessageCount(params) { groupChannelCount, feedChannelCount, e ->
    if (e != null) {
        // Handle error.
    }

    // ...
}

List of parameters

Copy link
Parameter nameTypeDescription

superChannelFilter

SuperChannelFilter

Specifies the message type to filter the messages with the corresponding type. Acceptable values are ALL, NONSUPER_CHANNEL_ONLY, EXCLUSIVE_CHANNEL_ONLY, and SUPER_CHANNEL_ONLY.

channelCustomTypes

string

Specifies the custom channel type to retrieve channels with the corresponding custom type.