For Android, iOS, JS SDK version 6.5.0 and below and TS SDK version v0.0.1-beta.42.3
The ChannelRepository
object exposes a totalUnreadCount
property that reflects the number of messages that the current user has yet to read. This count is the sum of all the unreadCount
channels properties where the user is already a member.
Version 6
The ChannelRepository
provides getTotalDefaultSubChannelUnreadCount()
method.
The ChannelRepository
provides getTotalUnreadCount()
method. It's giving the flowable of the number of messages that the current user has yet to read. This count is the sum of all the unreadCount
channels properties where the user is a member of.
To check whether the current user has been mentioned on one of the unread messages:
Version 6
The Channel
object exposes a unreadCount
property that reflects the number of messages that the current user has yet to read. This count is the sum of all the unreadCount
channels properties where the user is already a member. It also provides hasMention which is a boolean presenting having a mention for current user in channel.
The startReading()
and stopReading()
methods let the server know that the current user is reading a channel. After the startReading()
and stopReading()
methods are called, the unreadCount
is reset to 0.
You can call both methods as much you'd like, the SDK takes care of multi-device management: therefore a user can read multiple channels, from one or multiple devices at the same time. In case of an abrupt disconnection (whether because the app was killed, or the internet went down, etc.), the SDK backend will automatically call the stopReading
on the user's behalf.