问题描述
解决方案
你是使用EaseUI开发,还是自己通过老的demo自己集成sdk开发的?
解决方案二:
获取未读数直接使用我们demo的接口就可以得,如下:Hashtable<String, EMConversation> conversations = EMChatManager.getInstance().getAllConversations();conversation.getUnreadMsgCount();
解决方案三:
public int getUnreadMsgCountTotal() { int unreadMsgCountTotal = 0; int chatroomUnreadMsgCount = 0; unreadMsgCountTotal = EMChatManager.getInstance().getUnreadMsgsCount(); for(EMConversation conversation:EMChatManager.getInstance().getAllConversations().values()){ if(conversation.getType() == EMConversationType.ChatRoom) chatroomUnreadMsgCount=chatroomUnreadMsgCount+conversation.getUnreadMsgCount(); } return unreadMsgCountTotal-chatroomUnreadMsgCount; }调用这个方法
时间: 2024-10-03 15:37:51