Add a new message type
You can create new message types other than the ones provided by Sendbird UIKit.
Sending messages with custom data
First, define the custom message type. Sendbird UIKit reserves message types from
1000. You should define custom message types from
1001 as shown in the sample code below.
Before sending a message, you can set its
customType. You can also include data that will be used to render the UI for this custom message.
Drawing new message types
Rendering a new message type is similar to declaring a
viewType in an Android
RecyclerView. First, you inherit from
MessageListAdapter and implement the
getItemViewType() method. Based on the custom type returned from
getItemViewType(), you can render a custom
ViewHolder. Follow the sample code below.
For an in-depth practical demonstration, see our sample code.