Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The SDK provides a simple way for clients to retrieve the unread count for a sub channel. To view the unread count for a sub channel, we can get it from a sub channel object. This count represents the number of messages that you have not yet read in that sub channel.
To check if a sub channel supports the Unread Count feature, you can use the following code:
The SDK provides a simple way for clients to retrieve the unread count for a channel. To view the unread count for a channel, we can get it from a channel object. This count represents the number of messages that you have not yet read in that channel.
To check if a channel supports the Unread Count feature, you can use the following code:
To get the mention status of the current user in a channel, developers can use the following code.
To get the mention status of the current user in a sub channel, developers can use the following code.
To ensure that the message read count is up to date for a subchannel, users need to start reading the sub channel. When a user opens a subchannel, the chat system updates the read count for all messages in that channel, based on the user's reading status. This feature is designed to provide accurate read counts for sub channels, ensuring that users have a clear understanding of which messages have been read and which are still unread
Active reading of a subchannel and letting the chat system know that reading status can update the message read count in that sub channel. The system will update the read count for all messages in the sub channel that the user has not yet read.
To maintain an accurate message read count, users should stop reading a sub channel when they have finished reading it. The chat system updates the read count based on the user's reading status, so if a user leaves a sub channel, they should stop reading to avoid reading new messages.
stopReading
will be called automatically if the internet connection drops or is disconected. It lasts for one minute. This means that if an internet connection drops after one minute, stopReading
will be automatically called, and after it is re-established, startReading
will be called again.
This function enables users to obtain the current user's total count of unread messages and their mention status across all channels and sub-channels. To retrieve this value, utilize the CoreClient and follow the code pattern below.
Please note that the TypeScript SDK does not yet support retrieving mention status information with this function.
Clearing all unread counts in a channel is a useful feature that allows users to easily keep track of their message history. To accomplish this, the SDK provides a convenient method to mark all messages within a channel as read, effectively clearing the unread count. This method can be called by invoking the markAsRead()
function on the ChannelRepository
class with the appropriate channelId
parameter.
Once called, the function will iterate through all messages in subchannels within the specified channel and mark each as read. This process will clear the unread count.
Please note that clearing unread counts in a channel only applies to the specified channel and does not affect any other channels or subchannels. Additionally, clearing unread counts does not delete any messages or modify their content in any way. It simply updates their status to reflect that they have been read by the user.
When you send a message to someone, it's important to know whether that message has been delivered to the recipient's device or not. This is where the "Mark message delivered" function comes in.
By calling this function, you can update the status of a message to "delivered", which indicates that the message has been successfully delivered to the recipient's device. This can be useful for ensuring that important messages have been received by the intended recipient.
The parameters for this function are:
subchannelId
: The ID of the subchannel where the message is located.
messageId
: The ID of the message you want to mark as delivered.
In a chat application, it is often necessary to track which users have read a message. The Get Message's Read User function allows developers to retrieve a list of users who have read a particular message. This function can be useful for a variety of purposes, such as displaying read receipts or tracking user engagement with a particular message.
To use this function, you can call the getMessageReadUsers
method, this will return a collection of users who have read the message.
It is also important for users to know whether their messages have been successfully delivered to the intended recipients. The "Get message's delivered user" function allows users to query the list of users who have marked a particular message as delivered. This feature can be useful in scenarios where users need to know whether their messages have reached their intended recipients, such as in a customer service application or a team collaboration tool.
The function takes a message ID as a parameter, and returns a collection of user objects who have marked the message as delivered. By observing the live collection, users can receive real-time updates as new users mark the message as delivered.
The unread count feature in chat channels and subchannels allows you to keep track of new messages and stay up-to-date with ongoing conversations. By providing a simple indicator of unread messages, users can quickly prioritize which channels require their attention. This topic provides instructions for managing unread messages in a chat channel and sub-channel.
Note: we only support unread count on community, conversation, and broadcast channels. We do not support this feature in live channels. Mention unread in channels and subchannels aren't supported as well.
To enable the unread message count feature on the device, the user must start unread count syncing. This ensures that the user, as well as all channels and subchannels, have an up-to-date message unread count. To disable this feature, users simply stop the unread count syncing, which will stop updating the message unread count from their device.
To start unread count syncing, you can use the following code:
To stop unread count syncing, you can use the following code: