Add or remove a user event handler
To receive information about events related to users connected to the Sendbird server, add a user event handler with its UNIQUE_HANDLER_ID
by calling sb.addUserEventHandler()
.
If you want to stay informed of changes related to users and notify the changes to different client apps, define and register multiple channel event handlers using the UNIQUE_HANDLER_ID
.
User event types
List of user events
Method | Invoked when | Notified devices |
---|---|---|
onTotalUnreadMessageCountChanged() | There has been an update on the total number of a user's unread messages because the user read messages in group channels. | The user's devices running client apps. The devices are notified with the total number of unread messages and the number of unread messages by custom channel type. |
Add a user event handler
The following code shows the supported event callback with its parameters and how to add a user event handler to the unique SendbirdChat
instance.
Note: The
countByCustomTypes
attribute is turned off by default. Contact us if you wish to use this feature.
Remove a user event handler
The following code shows how to remove the user event handler.