Rate this page:

VIMessage

Interface that represents message within a conversation.

Props

conversation

Copy URL
@property (strong, readonly, nonatomic) 

NSString *

conversation

The UUID of the conversation this message belongs to.

The message can belong to the one conversation only.

Returns

  • type:

    NSString *

payload

Copy URL
@property (strong, readonly, nonatomic) 

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

payload

An array of payload objects associated with the message.

Returns

  • type:

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

sequence

Copy URL
@property (assign, readonly, nonatomic) 

SInt64

sequence

The message sequence number in the conversation.

Returns

  • type:

    SInt64

text

Copy URL
@property (strong, readonly, nonatomic) 

NSString *

text

A text of this message.

Returns

  • type:

    NSString *

uuid

Copy URL
@property (strong, readonly, nonatomic) 

NSString *

uuid

The universally unique identifier (UUID) of the message.

Returns

  • type:

    NSString *

Methods

remove:

Copy URL
- (

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

Returns

  • type:

    void

update:payload:completion:

Copy URL
- (

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

Returns

  • type:

    void