Read Status & Unread Count (Legacy)
For Android, iOS, JS SDK version 6.5.0 and below and TS SDK version v0.0.1-beta.42.3
Last updated
For Android, iOS, JS SDK version 6.5.0 and below and TS SDK version v0.0.1-beta.42.3
Last updated
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.
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.