Channels

When you retrieve a channel from the API (e.g. using query channels), the read state for all members is included in the response. This allows you to display which messages are read by each user. For each member, we include the last time he or she marked the channel as read.

// Every channel maintains a full list of read state for each channel member
foreach (var read in channel.Read)
{
  Debug.Log(read.User); // User
  Debug.Log(read.UnreadMessages); // How many unread messages
  Debug.Log(read.LastRead); // Last read date
}

Unread Messages Per Channel

You can retrieve the count of unread messages for the current user on a channel like this:

// Every channel maintains a full list of read state for each channel member
foreach (var read in channel.Read)
{
  Debug.Log(read.User); // User
  Debug.Log(read.UnreadMessages); // How many unread messages
  Debug.Log(read.LastRead); // Last read date
}

Unread Mentions Per Channel

You can retrieve the count of unread messages mentioning the current user on a channel like this:

// Will be implemented soon, raise a GitHub issue if you need this feature https://github.com/GetStream/stream-chat-unity/issues/

Mark All As Read

You can mark all channels as read for a user like this:

// Mark this message as last read
await message.MarkMessageAsLastReadAsync();

// Mark whole channel as read
await channel.MarkChannelReadAsync();
© Getstream.io, Inc. All Rights Reserved.