Send group read receipts
Report member-level read receipts for group messages and listen for group read status changes.
Member-level group read receipts are a Commercial Edition capability. All messages submitted in a single batch must belong strictly to the specified group conversation.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target group conversation ID. |
clientMsgIDs | string[] | Yes | Array of clientMsgID values marking visible read messages. |
Code example
import { sendGroupMessageReadReceipt } from '@/uni_modules/unix-openim-sdk'
await sendGroupMessageReadReceipt({
conversationID,
clientMsgIDs: visibleUnreadMessageIDs,
})Do not mix message IDs from different conversations, and avoid sending receipts for messages that have not yet scrolled into visible view.
Return value
The Promise resolves with void upon successful server processing.
State changes after the call
Promise resolution indicates that the receipt report was processed by the server; it does not mean other client devices have finished rendering reader updates. Conversation unread counts are maintained separately by conversation-level read operations; this method exclusively tracks member-level reader details in groups.
Listen for group read receipt changes
Centrally register onRecvGroupReadReceipt to monitor group read receipts. The event provides an opaque string notification signal. Treat this signal as an invalidation trigger to re-query the reader breakdown for currently visible group messages.
import { off, onRecvGroupReadReceipt } from '@/uni_modules/unix-openim-sdk'
const handleGroupReadReceipt = (_payload: string) => {
reloadVisibleGroupMessageReaders()
}
const groupReadReceiptSubscription =
onRecvGroupReadReceipt(handleGroupReadReceipt)
function removeGroupReadReceiptListener() {
off(groupReadReceiptSubscription)
}Reporting receipts, receipt event arrival, and querying readers via Get group message readers represent three decoupled stages. Unregister the listener when leaving the conversation or switching accounts.
Was this page helpful?