Browse SDKs · React Native
SDKsReact NativeEnterprise

Report group messages as read

OpenIM React Native SDK guide for report group messages as read.

Copy

Use sendGroupMessageReadReceipt() to report messages read in a group chat.

await OpenIMSDK.sendGroupMessageReadReceipt({
  conversationID,
  clientMsgIDs,
});

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesGroup conversation ID.
clientMsgIDsstring[]YesIDs of messages that were read; all must belong to the group conversation.

After the call completes, the read receipt has been reported. To update the conversation unread count, see Mark a conversation as read.

Listen for group read-status changes

When group message read status changes, OnRecvGroupReadReceipt is emitted with GroupMessageReceiptInfo, including conversationID, read and unread counts, and readers for each message.

function handleGroupReadReceipt(payload) {
  // ...
}

// Set the listener
OpenIMSDK.on(OpenIMEvent.OnRecvGroupReadReceipt, handleGroupReadReceipt);

// Remove the listener
OpenIMSDK.off(OpenIMEvent.OnRecvGroupReadReceipt, handleGroupReadReceipt);

Remove the listener when the component is destroyed, the account signs out, or the account changes.