Rate this page:

IMessage

Interface that represents a message within a conversation.

Methods

getConversation

Copy URL

String

getConversation()

Get the UUID of the conversation this message belongs to.

The message can belong to the one conversation only.

Returns

  • type:

    String

getPayload

Copy URL

List<Map<String, Object>>

getPayload()

Get the list of payload objects associated with the message.

Returns

  • type:

    List<Map<String, Object>>

getSequence

Copy URL

long

getSequence()

Get the message sequence number in the conversation.

Returns

  • type:

    long

getText

Copy URL

String

getText()

Get the text of this message.

Returns

  • type:

    String

getUUID

Copy URL

String

getUUID()

Get the universally unique identifier (UUID) of the message.

Returns

  • type:

    String

remove

Copy URL

void

remove(

IMessengerCompletionHandler<IMessageEvent>

handler
)

Remove the message from the conversation.

The participant that calls this method should have:

To get the method call result use one of the following options:

  1. Specify the handler parameter to consume the results with IMessageEvent or IErrorEvent in case of success/error accordingly.
  2. Implement the IMessengerListener.onRemoveMessage(IMessageEvent) and IMessengerListener.onError(IErrorEvent) events.

Other parties of the conversation (online participants and logged in clients) can be informed about the message removing via the IMessengerListener.onRemoveMessage(IMessageEvent) event.

Parameters

Returns

  • type:

    void

update

Copy URL

void

update(

String

text,

List<Map<String, Object>>

payload,

IMessengerCompletionHandler<IMessageEvent>

handler
)

Send text and payload changes to the cloud.

The participant that calls this method should have:

To get the method call result use one of the following options:

  1. Specify the handler parameter to consume the results with IMessageEvent or IErrorEvent in case of success/error accordingly.
  2. Implement the IMessengerListener.onEditMessage(IMessageEvent) and IMessengerListener.onError(IErrorEvent) events.

Other parties of the conversation (online participants and logged in clients) can be informed about the message updating via the IMessengerListener.onEditMessage(IMessageEvent) event.

To be informed about the message updating while being offline, participants can subscribe to the MessengerNotification.ON_EDIT_MESSAGE messenger push notification.

Parameters

  • text:

    String

    New text of this message, maximum 5000 characters. If null, message text will not be updated.

  • payload:

    List<Map<String, Object>>

    New payload of this message. If null, message payload will not be updated.

  • Completion handler to get the result or null

Returns

  • type:

    void