I register a listener for when the total unread count changes. Recently we added a new channel customType and we do not want to include the unread messages from the channels with the new customType. unreadCount
changes as expected, but countByCustomTypes
is always {}
const sb = Sendbird.getInstance()
const userId = sb.currentUser.userId
const userEventHandler = new sb.UserEventHandler()
userEventHandler.onTotalUnreadMessageCountUpdated = (unreadCount, countByCustomTypes) => {
console.log(unreadCount, countByCustomTypes)
// do something with values
}
sb.addUserEventHandler(userId, userEventHandler)
Current sendbird version: sendbird@3.0.153