getUnreadCount
public abstract void getUnreadCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话的未读消息数。
注意:不包含聊天室,聊天室消息不计数。
Since
5.1.1
Parameters
conversationType
会话类型 io.rong.imlib.model.Conversation.ConversationType 。
targetId
会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。
channelId
消息所属会话的业务标识。
callback
未读消息数的回调。
public abstract void getUnreadCount( IRongCoreCallback.ResultCallback<Integer> callback, String channelId, Array<ConversationType> conversationTypes)
获取指定会话类型的总未读消息数。
注意:不包含聊天室,聊天室消息不计数。
Since
5.1.1
Parameters
callback
未读消息数的回调。
channelId
消息所属会话的业务标识。
conversationTypes
会话类型,可传多个会话类型。
public abstract void getUnreadCount( Array<ConversationType> conversationTypes, String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话类型的总未读消息数。
注意:不包含聊天室,聊天室消息不计数。
Since
5.1.1
Parameters
conversationTypes
会话类型数组 io.rong.imlib.model.Conversation.ConversationType 。
channelId
消息所属会话的业务标识。
callback
未读消息数的回调。
containBlocked
是否包含免打扰消息的未读消息数。
public abstract void getUnreadCount( String targetId, ConversationType conversationType, Array<String> objectNames, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话内指定消息类型的未读消息数(聊天室会话除外)
Since
5.1.5
Parameters
targetId
会话目标 ID
conversationType
会话类型
objectNames
消息类型数组
channelId
消息所属会话的业务标识
callback
未读数结果的回调
public abstract void getUnreadCount( List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取会话未读消息数
Since
5.2.5
Parameters
conversationTypes
会话类型列表:[单聊、群聊、超级群]
levels
免打扰类型列表 [PushNotificationLevel]
callback
获取会话未读消息数回调