Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Mark all conversations as read

Clear unread message counts across all conversations for the authenticated user.

Copy

When a user taps a "Mark all as read" button in the conversation list, invoke markAllConversationMessageAsRead() to clear all unread message counts across all conversations for the currently authenticated account. This method accepts no parameters.

Code example

import { markAllConversationMessageAsRead } from '@/uni_modules/unix-openim-sdk'

await markAllConversationMessageAsRead()

Return value

The Promise resolves with void upon successful completion.

State changes after the call

Promise resolution indicates that the SDK processed the read state for all currently identified unread conversations. It does not imply that all subsequent conversation events have arrived or that other logged-in clients have finished rendering updates.

Update your local list state as onConversationChanged events deliver the zeroed unreadCount values (indexed by conversationID), and update global tab badges via onTotalUnreadMessageCountChanged. For listener implementations, see Retrieve conversation list and Get total unread count. To calibrate state after network reconnects, re-query the conversation list and total unread count.