Report group messages as read
Report group-message read receipts with the WASM SDK.
await openimsdk.sendGroupMessageReadReceipt({
conversationID,
clientMsgIDList: visibleUnreadMessageIDs,
});Every message in one batch must belong to the target group conversation. Promise completion means only that the server accepted the report; it does not mean other client interfaces have already updated. The conversation unread count is maintained separately through markConversationMessageAsRead().
Other clients receive member-level group read changes through CbEvents.OnRecvGroupReadReceipt. This page is the canonical reference for that event. Merge each message's hasReadCount, unreadCount, and member information by conversationID + clientMsgID.
import { CbEvents } from '@openim/wasm-client-sdk';
const handleGroupReadReceipt = ({ data }) => {
mergeGroupReadReceipt(data);
};
openimsdk.on(CbEvents.OnRecvGroupReadReceipt, handleGroupReadReceipt);
function removeGroupReadReceiptListener() {
openimsdk.off(CbEvents.OnRecvGroupReadReceipt, handleGroupReadReceipt);
}Call removeGroupReadReceiptListener() when the component unmounts, the user logs out, or the active account changes. The report Promise, the group receipt event, and the member snapshot from Get members who read a group message are three independent stages.
Was this page helpful?