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 channelDidUpdateReadStatus(_:)
delegate method in the GroupChannelDelegate
and didUpdateTotalUnreadMessageCount(unreadMessageCount:)
delegate method in the UserEventDelegate
.
In the meantime, the channelDidUpdateReadStatus(_:)
delegate method of GroupChannelDelegate
can also be implemented to listen to read status updates by other channel members.
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 |
completionHandler | SBErrorHandler? | The completion handler that passes an optional |