android中使用Leancloud即时通讯获取未读消息

来源:互联网 发布:科蒂斯电动牙刷 知乎 编辑:程序博客网 时间:2024/06/04 18:09

如题,根本就没有找到获取未读消息个数的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;    }