SIGN UP

VIMessage

Interface that represents message within a conversation.

Methods

remove:

- (void)remove:(nullable VIMessengerCompletion<VIMessageEvent *> *)completion

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 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

update:payload:completion:

- (void)update:(nullable NSString *)text
       payload:(nullable NSArray<NSDictionary<NSString *,NSObject *> *> *)payload
    completion:(nullable VIMessengerCompletion<VIMessageEvent *> *)completion

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 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 will not be updated.

  • payload:

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

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

  • completion:

    nullable VIMessengerCompletion<VIMessageEvent *> *

    Completion handler to get the result or nil

Properties

conversation

@property (nonatomic, strong, readonly) NSString *conversation

The UUID of the conversation this message belongs to.

The message can belong to the one conversation only.

payload

@property (nonatomic, strong, readonly) NSArray<NSDictionary<NSString *, NSObject *> *> *payload

An array of payload objects associated with the message.

sequence

@property (nonatomic, assign, readonly) SInt64 sequence

The message sequence number in the conversation.

text

@property (nonatomic, strong, readonly) NSString *text

A text of this message.

uuid

@property (nonatomic, strong, readonly) NSString *uuid

The universally unique identifier (UUID) of the message.