iOS/Swift
Message Actions Confused about "Message Actions"?
Let us know how we can improve our documentation:
Confused about "Message Actions"?
Let us know how we can improve our documentation:
LAST EDIT Feb 16 2021
- On This Page:
- Actions
- Customization
Messages have actions. They will appear if a user long (or force) presses on a message.
ActionsCopied!Confused about "Actions"?
Let us know how we can improve our documentation:
Confused about "Actions"?
Let us know how we can improve our documentation:
.reactions
.reply
.edit
.muteUser
.flagMessage
.flagUser
.banUser
.copy
.delete
CustomizationCopied!Confused about "Customization"?
Let us know how we can improve our documentation:
Confused about "Customization"?
Let us know how we can improve our documentation:
Customizing actions is not yet possible in the new v3 SDK. Stay tuned!
PropertiesCopied!Confused about "Properties"?
Let us know how we can improve our documentation:
Confused about "Properties"?
Let us know how we can improve our documentation:
ChatViewController
has messageActions
and defaultMessageActions
properties.
You can customize a list of message actions:
override
defaultMessageActions
in your subclass:
1
2
3
override var defaultMessageActions: ChatViewController.MessageAction {
return [.reactions, .copy]
}
change
messageActions
when you initializeChatViewController
:
1
2
let chatViewController = ChatViewController()
chatViewController.messageActions = [.reactions, .copy]
or
1
2
3
4
5
6
class MyChatViewController: ChatViewController {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
messageActions = [.reactions, .copy]
}
}
MethodCopied!Confused about "Method"?
Let us know how we can improve our documentation:
Confused about "Method"?
Let us know how we can improve our documentation:
You can override long-press action with this method of ChatViewController
:
1
open func showActions(from cell: UITableViewCell, for message: Message, locationInView: CGPoint)