Receive messages in an open channel
Users can receive messages from other participants through the onMessageReceived()
method in the channel event handler. A BaseMessage
object for each received message is one of the following message types.
Message type | Class | Description |
---|---|---|
Text | A text message sent by a user. | |
File | A binary file message sent by a user. | |
Admin | A text message sent by an admin through the Chat API |
To register multiple concurrent handlers, pass a UNIQUE_HANDLER_ID
argument as a unique identifier into the SendbirdChat.addChannelHandler()
method.
When the UI isn't valid anymore, remove the channel event handler.
Event handler for message threading
Once a reply is created or deleted from a thread, the onThreadInfoUpdated()
event handler is invoked. The method returns a ThreadInfoUpdateEvent
object that has the latest information about the thread. This object needs to be applied to the parent message object.
Note: Like other messages, when a reply is created in a channel, the
onMessageReceived()
method of the channel event handler in client apps is called.
List of parameters
Parameter name | Type | Description |
---|---|---|
channel | BaseChannel | Specifies the channel that has the message thread. |
threadInfoUpdateEvent | ThreadInfoUpdateEvent | Specifies a |