Browse SDKs · Flutter
SDKsFlutter

Mark a conversation as read

Mark messages in a specified conversation as read with the OpenIM Flutter SDK.

Copy

Call this method after the user opens a conversation and finishes reading the currently visible messages:

await OpenIM.iMManager.conversationManager.markConversationMessageAsRead(
  conversationID: conversationID,
);

Do not mark messages as read merely because the app previewed a notification or received a message in the background. A successful Future means that the request completed, not that onConversationChanged has already arrived. Merge the latest ConversationInfo by conversationID; query the conversation again when immediate confirmation is required.

For a one-to-one chat, after the current user marks the conversation as read, the other participant can receive message read receipts through onRecvC2CReadReceipt. This page owns that callback. For each ReadReceiptInfo, first validate that sessionType is one-to-one and userID is non-empty. Resolve conversationID from the other user's ID, then update read state for each non-empty clientMsgID in msgIDList.

void handleC2CReadReceipts(List<ReadReceiptInfo> items) {
  for (final receipt in items) {
    mergeC2CReadReceipt(receipt);
  }
}

Pass handleC2CReadReceipts to onRecvC2CReadReceipt in the application's single OnAdvancedMsgListener. See Events overview for centralized listener setup. The pinned Flutter SDK does not provide member-level group-message read receipts.