-
The unread message count is stored in localStorage. It’s specific to the current client, and the server doesn’t store it.
-
Clearing the local cache will cause the SDK to fetch offline/compensation messages again, and the unread count will be recalculated.
-
Avoid directly clearing the browser cache or localStorage. If your code must delete localStorage data, only clear the data you’ve set, not everything.
-
Use multi-device unread count synchronization to solve this issue.
-
Call RongIMLib.clearMessagesUnreadStatus to clear the unread count.
-
After clearing, call RongIMLib.sendSyncReadStatusMessage to sync the unread count.
-
Note: Switch the document version based on the SDK you’re using.