Message
This API is in beta and subject to change.
Class 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
payload:
List<Map<String, Any>>?
OptionalNew payload of this message.
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
toString
fun toString(): String
Returns
type:
String
Props
uuid
val uuid: String
This API is in beta and subject to change.
The universally unique identifier (UUID) of the message.
Returns
type:
String
conversationUuid
val conversationUuid: String
This API is in beta and subject to change.
The UUID of the conversation this message belongs to.
Returns
type:
String
text
val text: String?
This API is in beta and subject to change.
The text of this message.
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>>?
sequence
val sequence: Long
This API is in beta and subject to change.
The message sequence number in the conversation.
Returns
type:
Long