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

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

版权声明:本文为lzq520210原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。