标记消息已读 - GoEasy IM

对于收到且已读的消息,需要标记为已读状态,否则会话列表里的未读消息数字始终保持原来数字,并且在下次连接GoEasy时,GoEasy会重复下发之前未标记的消息。

执行本接口后,会自动触发会话列表变化,该会话的的未读数量会自动更新。

将指定单聊标记为已读


    im.markPrivateMessageAsRead({
        userId:'user-001',  //聊天对象的userId
        onSuccess: function () { //标记成功
            console.log("Marked as read successfully.") 
        },
        onFailed: function (error) { //标记失败
            console.log("Failed to mark as read, code:" + error.code + " content:" + error.content);
        }
    });

将指定群聊标记为已读

    im.markGroupMessageAsRead({
        groupId:'group-001',
        onSuccess: function () {//标记成功
            console.log("Marked as read successfully.") 
        },
        onFailed: function (error) { //标记失败
            console.log("Failed to mark as read, code:" + error.code + " content:" + error.content);
        }
    })

results matching ""

    No results matching ""