Mark messages as unread
Marking messages as unread allows users to flag messages for later review or to keep track of messages that they haven't read yet. This status change is only visible to the user who marked the message as unread, and it doesn't affect other users in the channel.
This document explains how to mark messages as unread in a group channel.
Read status and unread message count
To mark messages as unread, call the markAsUnread()
method on the GroupChannel
object. You must specify a message that you want to mark as unread
. This will be the starting point for the unread status. Messages after this are also treated as unread. Once marked, the SDK updates the unread message count of the group channel and triggers the onChannelChanged()
methods in the GroupChannelHandler
.
To listen to the changes in the read status by other channel members, add a user event handler to the SendbirdChat
instance and define the onTotalUnreadMessageCountChanged()
method with the actions to perform when notified.
List of parameters
Parameter name | Type | Description |
---|---|---|
message | BaseMessage | The message that should be the starting point for the unread status. Messages after this will also be treated as |