SDKsReact NativeEnterprise
Report group messages as read
OpenIM React Native SDK guide for report group messages as read.
Use sendGroupMessageReadReceipt() to report messages read in a group chat.
await OpenIMSDK.sendGroupMessageReadReceipt({
conversationID,
clientMsgIDs,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Group conversation ID. |
clientMsgIDs | string[] | Yes | IDs 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.
Was this page helpful?