Is there a way to fetch unread messages for a user in a group channel? We want to notify users in an email that they have unread messages and would like to get all unread messages to provide context to the user.
1 Like
Hello @HankHeadRace
Welcome to the Sendbird community!
Yes, you can fetch the number of unread messages for a user in a group channel using the Sendbird Chat SDK. You can use the getUnreadMessageCount()
method to retrieve the number of unread messages for a specific user in a group channel. The getUnreadMessageCount()
method returns the total number of unread messages in the group channel for the current user.
Then, you can use the getMessagesByTimestamp()
method to fetch all unread messages in the group channel. You can process these unread messages and provide context to the user as needed.
Reference: Retrieve number of members who haven't read a message | Chat JavaScript SDK | Sendbird Docs
Let me know if this helps.