Skip to main content
Version: v4

MessageTouchableHandlerPayload

MessageTouchableHandlerPayload object is provided as param to callback handlers such as onLongPressMessage, onPressMessage for user interaction with message.

Example#

{
defaultHandler: [function],
emitter: 'giphy',
event: [Native Event Object],
actionHandlers: {
deleteMessage: [function],
editMessage: [function],
quotedReply: [function],
resendMessage: [function],
showMessageOverlay: [function],
toggleBanUser: [function],
toggleMuteUser: [function],
toggleReaction: [function],
},
message: [message object],
}

Keys and values#

defaultHandler#

Default handler function for corresponding interaction.

Type
function

emitter#

Location within message, where the interaction occured.

Type
enum('card', 'fileAttachment', 'gallery', 'giphy', 'message', 'messageContent', 'messageReplies', 'reactionList', 'textLink', 'textMention')

event#

Native event object which could either be coming from TouchableOpacity or react-native-gesture-handler

Type
object

actionHandlers#

Set of action handler functions for various message actions. You can use these functions to perform any action when give interaction occures.

  • deleteMessage
  • editMessage
  • quotedReply
  • resendMessage
  • showMessageOverlay
  • toggleBanUser
  • toggleMuteUser
  • toggleReaction (takes reactionType as param)
<Channel onLongPressMessage={({ defaultHandlers }) => defaultHandlers.quotedReply()}
Type
object

message#

Message object, on which interaction occured.

<Channel onLongPressMessage={({ message }) => console.log(message.id, message.text)}
Type
object

Did you find this page helpful?