Browse SDKs · React Native
Platform
SDKsReact NativeEnterprise

Send group read receipts

Report read receipts for messages in a group chat using the OpenIM React Native SDK.

Copy

Submit read receipts in batches for messages read within a group conversation:

Invoke this method when a user views incoming messages from other group members in the active chat screen. Group members receive read status updates accordingly.

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

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesTarget group conversation ID.
clientMsgIDsstring[]YesArray of client message IDs that have been read; all messages must belong to the specified group conversation.

Return value

A resolved Promise confirms that the read receipt submission was accepted by the server. To reset or clear the unread counter for the current user in this conversation, invoke Mark conversation read.

Listen for group read status changes

When other group members view messages and report read receipts, the SDK emits the OnRecvGroupReadReceipt event. The callback payload contains GroupMessageReceiptInfo, specifying the target conversationID alongside updated read and unread counts for each message. Update UI read count badges using clientMsgID as the composite key.

interface GroupMessageReceiptItem {
  clientMsgID: string;
  readCount: number;
  unreadCount: number;
}

interface GroupMessageReceiptInfo {
  conversationID: string;
  receiptList: GroupMessageReceiptItem[];
}

const handleGroupReadReceipt = (payload: GroupMessageReceiptInfo) => {
  // Match the conversation by payload.conversationID and update read counters by clientMsgID
};

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

// Unregister listener on cleanup
OpenIMSDK.off(OpenIMEvent.OnRecvGroupReadReceipt, handleGroupReadReceipt);

Always unregister listeners using identical function references when unmounting components or signing out.