如题,根本就没有找到获取未读消息个数的api,然后使用下面的方法,就可以获取到了
public int getAllUnreadCount() {
int unreadCount = 0;
LCIMConversationItemCache conversationItemCache = LCIMConversationItemCache.getInstance();
List<String> conversationList = conversationItemCache.getSortedConversationList();
for (String conversationId : conversationList) {
unreadCount += conversationItemCache.getUnreadCount(conversationId);
}
return unreadCount;
}