SDKsAndroidEnterprise
Report group messages as read
Report group-message read receipts with the Android SDK.
Report read receipts for group messages that the current user has viewed. As the conversation timeline scrolls or messages enter the visible viewport, pass the list of visible client message IDs to the server. This allows group message senders to track read and unread member counts in real time.
Code example
String conversationID = "g_group_123";
List<String> visibleClientMsgIDs = Arrays.asList("msg_001", "msg_002");
OpenIMClient.getInstance().messageManager.sendGroupMessageReadReceipt(
conversationID,
visibleClientMsgIDs,
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Read receipts reported successfully
}
@Override
public void onError(int code, String error) {
// Handle reporting failure
}
}
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | String | Yes | Globally unique ID of the target group conversation. |
clientMsgIDs | List<String> | Yes | List of client message IDs in the visible viewport to mark as read. All messages must belong to the specified conversation. |
base | OnBase<String> | Yes | Callback handler for the asynchronous request. |
Return value
Upon success, data in onSuccess returns a confirmation message.
State changes after the call
- Callback confirmation: The
onSuccesscallback indicates that the server accepted the read receipts. - Asynchronous event delivery: Group message senders and participants receive incremental read receipt events through
OnAdvanceMsgListener.onRecvGroupMessageReadReceipt:
@Override
public void onRecvGroupMessageReadReceipt(GroupMessageReceipt receipt) {
// Update read count and read status for messages matched by clientMsgID
}- Aggregate unread count separation: Group message read receipts update message-level reader counts. To clear the aggregate unread badge count for the conversation locally and on the server, call Mark a conversation as read.
- Member detail query: To view the full list of members who have or have not read a specific group message, see Get members who read a group message.
For complete listener registration and lifecycle management, see Receive messages.
Was this page helpful?