Message
This API is in beta and subject to change.
Interface that represents a message within a conversation.
Methods
update
fun update(text: String?
, payload: List<Map<String, Any>>?
, callback: ): Unit
This API is in beta and subject to change.
Sends text and payload changes to the cloud.
The participant that calls this method should have:
- the ConversationParticipant.canEditMessages permission to update its own messages
- the ConversationParticipant.canEditAllMessages permission to update other participants' messages
To get the method call result use one of the following options:
- Specify the callback parameter to consume the results with MessageEvent or ErrorEvent in case of success/error accordingly.
- Implement the MessengerListener.onEditMessage and MessengerListener.onError events.
Other parties of the conversation (online participants and logged in clients) can be informed about the message updating via the MessengerListener.onEditMessage event.
To be informed about the message updating while being offline, participants can subscribe to the MessengerNotification.OnEditMessage messenger push notification.
Parameters
text:
String?
OptionalNew text of this message, maximum 5000 characters If null, message text is not be updated.
payload:
List<Map<String, Any>>?
OptionalNew payload of this message. If null, message payload is not updated
callback:
OptionalCallback to be called when the function completes
Returns
type:
Unit
remove
fun remove(callback: ): Unit
This API is in beta and subject to change.
Removes the message from the conversation.
The participant that calls this method should have:
- the ConversationParticipant.canRemoveMessages permission to remove its own messages
- the ConversationParticipant.canRemoveAllMessages permission to remove other participants' messages
To get the method call result use one of the following options:
- Specify the callback parameter to consume the results with MessageEvent or ErrorEvent in case of success/error accordingly.
- Implement the MessengerListener.onRemoveMessage and MessengerListener.onError events.
Other parties of the conversation (online participants and logged in clients) can be informed about the message removing via the MessengerListener.onRemoveMessage event.
Parameters
callback:
OptionalCallback to be called when the function completes
Returns
type:
Unit
Props
conversation
val conversation: String
This API is in beta and subject to change.
The UUID of the conversation this message belongs to.
Returns
type:
String
payload
val payload: List<Map<String, Any>>?
This API is in beta and subject to change.
The list of payload objects associated with the message.
Returns
type:
List<Map<String, Any>>?
text
val text: String?
This API is in beta and subject to change.
The text of this message.
Returns
type:
String?
uuid
val uuid: String
This API is in beta and subject to change.
The universally unique identifier (UUID) of the message.
Returns
type:
String
sequence
val sequence: Long
This API is in beta and subject to change.
The message sequence number in the conversation.
Returns
type:
Long