Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Mark all conversations as read

Reset the unread count to zero across all conversations for the current account.

Copy

Mark all unread conversations as read in a single call:

Code example

import sdk from '@openimsdk/imsdk';

await sdk.markAllConversationMessageAsRead();

Return value

Returns a Promise that resolves to void when the SDK processes all unread conversations.

State changes after the call

Promise resolution indicates that the local engine has processed unread conversations; it does not mean that all real-time events have arrived or that other devices have completed synchronization. As conversation change events arrive, update each conversation's unreadCount matched by conversationID, and update your badge counter via the total unread event. For listener implementations, see Retrieve conversation list and Get total unread message count.