getUnreadCount

public abstract void getUnreadCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)

Retrieves the count of unread messages for a specified conversation.

Note: Chatroom messages are not included in the count.

Since

5.1.1

Parameters

conversationType

The type of conversation .

targetId

The ID of the conversation. Depending on the conversationType, it could be a user ID, discussion group ID, or group ID.

channelId

The business identifier of the conversation to which the message belongs.

callback

Callback for the unread message count.


public abstract void getUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback, String channelId, Array<ConversationType> conversationTypes)

Retrieves the total count of unread messages for specified conversation types.

Note: Chatroom messages are not included in the count.

Since

5.1.1

Parameters

callback

Callback for the unread message count.

channelId

Business identifier of the conversation to which the messages belong.

conversationTypes

Conversation types, multiple types can be passed.


public abstract void getUnreadCount(Array<ConversationType> conversationTypes, String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)

Retrieve the total count of unread messages for specified conversation types.

Note: Chatroom messages are not included in the count.

Since

5.1.1

Parameters

conversationTypes

Array of conversation types .

channelId

Business identifier of the conversation to which the messages belong.

callback

Callback for the unread message count.

containBlocked

Indicates whether to include unread messages from muted conversations.


public abstract void getUnreadCount(String targetId, ConversationType conversationType, Array<String> objectNames, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)

Retrieves the count of unread messages of specified types in a given conversation (excluding chatroom conversations).

Since

5.1.5

Parameters

targetId

The target ID of the conversation.

conversationType

The type of the conversation.

objectNames

An array of message types.

channelId

The business identifier of the conversation to which the messages belong.

callback

Callback for the unread count result.


public abstract void getUnreadCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)

Get the count of unread messages in conversations

Since

5.2.5

Parameters

conversationTypes

List of conversation types: [one-to-one chat, group chat, ultra group]

levels

List of Do Not Disturb levels [PushNotificationLevel]

callback

Callback for retrieving the count of unread messages in conversations