type
and category
of a message, the appearance and behavior of the header, content, and footer sections of the message bubble,
type
you can set the type of CometChatMessage, This will map your MessageTemplate to the corresponding CometChatMessage. You can set the MessageTemplate Type using the following code snippet.
category
you can set the category of a MessageTemplate. This will create a MessageTemplate with the specified category and link it with a CometChatMessage of the same category.
Please refer to our guide on Message Categories for a deeper understanding of message categories.
headerView
method allows you to assign a custom header widget to the MessageBubble. By default, it is configured to display the sender’s name.
contentView
method allows you to assign a custom content widget to the MessageBubble. By default, it displays the Text Bubble, Image Bubble, File Bubble, Audio Bubble, or Video Bubble, depending on the message type.
footerView
method allows you to assign a custom Footer widget to the MessageBubble. By default, it displays the receipt and timestamp.
bottomView
method allows you to assign a custom Bottom widget to the MessageBubble.By defuault is has buttons such as link previews or a ‘load more’ button for long messages.
bubbleView
method allows you to assign a custom Bubble widget to the MessageBubble. By default, headerView, contentView, and footerView together form a message bubble.
options
lets you set the list of actions that a user can perform on a message. This includes actions like reacting to, editing, or deleting a message.
headerView
method of MessageTemplate allows you to add custom widgets to the header of your message bubbles.
Here is the complete example for reference:
contentView
method of MessageTemplate allows you to add a custom widget to the content of your message bubbles.
Here is the complete example for reference:
bottomView
method of MessageTemplate allows you to add a custom button widget to your message bubbles.
Here is the complete example for reference:
footerView
method of MessageTemplate allows you to add a footer widget to your message bubbles.
Here is the complete example for reference:
bubbleView
method of MessageTemplate allows you to add a bubble widget to your message bubbles.
Here is the complete example for reference:
options
method in the MessageTemplate allows you to customize the options that appear in the action sheet when a message is long-pressed. By default, CometChat UI Kit provides a set of options like “Reply”, “Forward”, “Edit”, and “Delete”.
However, if you wish to override or modify these options, you can use the options
method and pass a list of CometChatMessageOption
. This list of options will replace the default set.
Here is the complete example for reference: