Rate this page:

VIMessage

Interface that represents a message within a conversation.

Props

conversation

Copy URL

UUID of the conversation this message belongs to.

The message can belong to the one conversation only.

Returns

  • type:

    NSString *

payload

Copy URL

Array of payload objects associated with the message.

Returns

  • type:

    NSArray<NSDictionary<NSString *, NSObject *> *> *

sequence

Copy URL

Message sequence number in the conversation.

Returns

  • type:

    SInt64

text

Copy URL

Text of the message.

Returns

  • type:

    NSString *

uuid

Copy URL

Universally unique identifier (UUID) of the message.

Returns

  • type:

    NSString *

Methods

remove:

Copy URL

Removes 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 completion parameter to consume the results with VIMessageEvent or VIErrorEvent in case of success/error accordingly.
  2. Implement the [VIMessengerDelegate messenger:didRemoveMessage:] and [VIMessengerDelegate messenger:didReceiveError:] events.

Other parties of the conversation (online participants and logged in clients) can be informed about the message removing via the [VIMessengerDelegate messenger:didRemoveMessage:] event.

Parameters

Returns

  • type:

    void

update:payload:completion:

Copy URL

Sends 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 completion parameter to consume the results with VIMessageEvent or VIErrorEvent in case of success/error accordingly.
  2. Implement the [VIMessengerDelegate messenger:didEditMessage:] and [VIMessengerDelegate messenger:didReceiveError:] events.

Other parties of the conversation (online participants and logged in clients) can be informed about the message updating via the [VIMessengerDelegate messenger:didEditMessage:] event.

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

Parameters

  • text:

    nullable NSString *

    New text of this message, maximum 5000 characters. If nil, message text is not updated

  • payload:

    nullable NSArray<NSDictionary<NSString *, NSObject *> *> *

    New payload of this message. If nil, message payload is not updated

  • completion:

    nullable VIMessengerCompletion<VIMessageEvent *> *

    Completion handler to get the result or nil

Returns

  • type:

    void