VIMessage
Interface that represents message within a conversation.
Props
conversation
String
conversation
The UUID of the conversation this message belongs to.
The message can belong to the one conversation only.
Returns
type:
String
payload
List<Map<String, dynamic>>
payload
The list of payload objects associated with the message.
Returns
type:
List<Map<String, dynamic>>
sequence
int
sequence
The message sequence number in the conversation.
Returns
type:
int
text
String
text
The text of this message.
Returns
type:
String
uuid
String
uuid
The universally unique identifier (UUID) of the message.
Returns
type:
String
Methods
remove
Future<VIMessageEvent>
remove()
Remove the message from the conversation.
The participant that calls this method should have:
- the VIConversationParticipant.canRemoveMessages permission to remove its own messages
- the VIConversationParticipant.canRemoveAllMessages permission to remove other participants' messages
Returns
type:
Future<VIMessageEvent>
update
Future<VIMessageEvent>
update({String?
text, List<Map<String, Object>>?
payload})
Send text and payload changes to the cloud.
The participant that calls this method should have:
- the VIConversationParticipant.canEditMessages permission to update its own messages
- the VIConversationParticipant.canEditAllMessages permission to update other participants' messages
To be informed about the message updating while being offline, participants can subscribe to the onEditMessage messenger push notification.
Parameters
text:
String?
OptionalNew text of this message, maximum 5000 characters. If null, message text will not be updated.
payload:
List<Map<String, Object>>?
OptionalNew payload of this message. If null, message payload will not be updated.
Returns
type:
Future<VIMessageEvent>