MessagesContext
Additional props provided to the underlying TouchableOpacity used by components within a message such as MessageContent
.
Animate with a pop the long-press action on the message bubble.
Type | Default |
---|
boolean | iOS: true Android: false |
Override of the Block UserMessageAction
shown when a user long presses a message.
The blockUser
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Id of current channel.
Override of the Copy MessageMessageAction
shown when a user long presses a message.
The copyMessage
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Override of the Delete MessageMessageAction
shown when a user long presses a message.
The deleteMessage
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Disable typing indicator in MessageList
.
Dismiss the keyboard when a user touches any of the messages in the list.
Override of the Edit MessageMessageAction
shown when a user long presses a message.
The editMessage
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Note: This prop is available only in SDK version >= v3.9.0
If false, consecutive messages from same user won’t be grouped together.
Override of the Flag MessageMessageAction
shown when a user long presses a message.
The flagMessage
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Forces alignment of messages in the list to either the left or right side of the screen.
By default, received messages are aligned on the left side of the screen, and sent messages are aligned on the right.
Type | Default |
---|
’left’ | ‘right’ | false | false |
Format function that returns a string to be used for the date in the message status and delete message component.
Parameter | Description |
---|
date | date to format provided as a string, Date, or number (Unix Timestamp) |
Function called when the Block User action is invoked from message actions list.
This function does not override the default behavior of the Block User action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when the Copy Message action is invoked from message actions list.
This function does not override the default behavior of the Copy Message action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when the Delete Message action is invoked from message actions list.
This function does not override the default behavior of the Delete Message action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when the Edit Message action is invoked from message actions list.
This function does not override the default behavior of the Edit Message action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when the Flag Message action is invoked from message actions list.
This function does not override the default behavior of the Flag Message action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when the Mute User action is invoked from message actions list.
This function does not override the default behavior of the Mute User action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when the Reply action is invoked from message actions list.
This function does not override the default behavior of the Reply action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when a reaction is selected in the message overlay, this is called on both the add and remove action.
This function does not override the default behavior of the reaction being selected.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
reactionType | string designating the type of reaction |
Function called when the Retry action is invoked from message actions list.
This function does not override the default behavior of the Retry action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function called when the Thread Reply action is invoked from message actions list.
This function does not override the default behavior of the Thread Reply action.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Load messages in a channel at the first unread message.
Object specifying rules defined within simple-markdown.
An array of, or function that returns and array of, actions that can be performed on a message shown in the message overlay.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
actionInfo | an object containing the original actions and relevant message data |
Order in which to render the content of a message.
Type | Default |
---|
array | [‘quoted_reply’, ‘gallery’, ‘files’, ‘text’, ‘attachments’] |
Note: This prop is available only in SDK version >= v3.7.0
Allow user to be muted via message action.
The default value is supplied by the channel config.
Override of the Mute UserMessageAction
shown when a user long presses a message.
The muteUser
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Theme applied to messages of the current user.
Function called when a user double taps a message.
Parameter | Description |
---|
payload | { actionHandlers, message } |
Function called when a user long presses a message.
The default opens the message actions overlay.
Parameter | Description |
---|
payload | { actionHandlers, message } |
Function called immediately when a touch is engaged on a message, before onPressMessage
.
Parameter | Description |
---|
payload | { actionHandlers, message } |
Function called when a user presses a message.
The default handler for message press interactions acts differently when pressing on reactions and attachments.
You will have to handle these cases when overriding this function.
Parameter | Description |
---|
payload | { actionHandlers, message } |
Allow messages to be replied to using inline quotation.
Override of the ReplyMessageAction
shown when a user long presses a message.
The quotedReply
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Allow reactions on messages.
The default value is supplied by the channel config.
Function to remove message from local channel state. Please note that this function is only for updating the local state, it doesn’t call the API for deleting message (channel.deleteMessage
).
Component to render preview of parent of message for quoted reply.
Type | Default |
---|
component | Reply |
Override of the Resend MessageMessageAction
shown when a user long presses a message.
The retry
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Function to re-attempt sending failed message.
Full override of the reaction function on a message.
This function must return a function that takes as a parameter the reactionType
as a string.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Enables editing state for given message.
Enables quoted-reply state on given message.
List of reactions which can be added on message.
Please refer to the guide on customizing reactions for details.
Allow messages to be replied to in a thread.
The default value is supplied by the channel config.
Override of the Thread ReplyMessageAction
shown when a user long presses a message.
The threadReply
function receives as a parameter the relevant message and must return a MessageAction
.
Please refer to the guide on customizing message actions for details.
Parameter | Description |
---|
message | message the action is called on |
Upserts a given message in local channel state. Please note that this function doesn’t call channel.sendMessage
. Channel component uses this function for optimistic updates to message.
Component for rendering attachments in MessageList.
Available props:
Component to render additional actions on attachment. for example send, shuffle, cancel in case of Giphy.
Component to render any custom type of attachment. Please check the guides for Custom Attachment
Component to render main body for Card
component which renders custom type of attachment.
Please check the guides for Custom Attachment.
Component to render footer for Card
component which renders custom type of attachment. Please check the guides for Custom Attachment.
Component to render header for Card
component which renders custom type of attachment. Please check the guides for Custom Attachment.
Component to render sticky date header within enclosed MessageList component.
Component to render ‘file’ type attachment in MessageList
.
Component to render group of file
type attachments, when there are multiple file
type attachments in message.
Component to render file icon for file
type attachment.
FlatList
component for underlying MessageList
component.
Component to render ‘image’ type attachments in the MessageList
.
Component to render Giphy type attachments in MessageList
.
Type | Default |
---|
component | Giphy |
Component to render inline date separators between messages which were created at a difference of more than a day.
Component to render inline separator in MessageList, to indicate the position of last read message in list.
Component to render avatar of sender for message, within MessageList
. This component is only rendered for messages from other users.
Component to render content of message including status, attachments, reactions etc., within MessageList
.
Component to render deleted message.
Component to render footer for message, within MessageList
.
Component to render header for message, within MessageList
.
Component to show number of thread replies and avatars of members who replied on message
Component to show avatars of members who thread replied on message.
Component to render a message within MessageList
.
Please check guides section for Customizing Message UI for details.
Component to render status of message, which includes time and read-receipts.
Component to render system
type messages. Purpose of system messages is to inform user about changes to channel. System messages are part of message history, and have a property type
set as system
.
You can add system messages within message history in following scenarios:
Component to render text of message. By default, we use Simple Markdown package to render the text content of message.
If you decide to use this prop, please be aware that you will need to handle the markdown rendering yourself.
Reaction selector component displayed within the message overlay when user long presses a message.
Component to render list of reactions at top of message bubble.
Component to render a button which when pressed, scrolls the message list to bottom.
Component to render typing indicator within enclosed MessageList component.
Component to render container in which typing indicator gets rendered within enclosed MessageList component.
Component to render preview of URLs in MessageList
.