/ SDKs / iOS
SDKs
Chat SDKs iOS v4
Chat SDKs iOS
Chat SDKs
iOS
Version 4

Retrieve number of unread messages in all channels

Copy link

By using the getTotalUnreadMessageCount() method, you can retrieve the total number of unread messages of a user in all group channels the user joined.

let params = GroupChannelTotalUnreadMessageCountParams();
params.superChannelFilter = CHANNEL_TYPE_FILTER
params.channelCustomTypesFilter = CUSTOM_TYPE

SendbirdChat.getTotalUnreadMessageCount(params: params) { count, error in
    guard error == nil else {
        return // Handle error.
    }
}

List of parameters

Copy link
Parameter nameTypeDescription

superChannelFilter

GroupChannelSuperChannelFilter

Specifies the message type to filter the messages with the corresponding type. Acceptable values are all, super, nonSuper, and exclusiveOnly.

channelCustomTypesFilter

string

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