VIMessage
Interface that represents a message within a conversation.
Props
conversation
@property (strong, readonly, nonatomic) NSString *
conversation
UUID of the conversation this message belongs to.
The message can belong to the one conversation only.
Returns
type:
NSString *
payload
@property (strong, readonly, nonatomic) NSArray<NSDictionary<NSString *, NSObject *> *> *
payload
Array of payload objects associated with the message.
Returns
type:
NSArray<NSDictionary<NSString *, NSObject *> *> *
sequence
@property (assign, readonly, nonatomic) SInt64
sequence
Message sequence number in the conversation.
Returns
type:
SInt64
text
@property (strong, readonly, nonatomic) NSString *
text
Text of the message.
Returns
type:
NSString *
uuid
@property (strong, readonly, nonatomic) NSString *
uuid
Universally unique identifier (UUID) of the message.
Returns
type:
NSString *
Methods
remove:
- (void
)remove:(nullable VIMessengerCompletion<VIMessageEvent *> *
)completion
Removes the message from the conversation.
The participant that calls this method should have:
- the [VIConversationParticipant canRemoveMessages] permission to remove its own messages
- the [VIConversationParticipant canRemoveAllMessages] permission to remove other participants' messages
To get the method call result use one of the following options:
- Specify the completion parameter to consume the results with VIMessageEvent or VIErrorEvent in case of success/error accordingly.
- 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
completion:
nullable VIMessengerCompletion<VIMessageEvent *> *
Completion handler to get the result or nil
Returns
type:
void
update:payload:completion:
- (void
)update:(nullable NSString *
)text
payload:(nullable NSArray<NSDictionary<NSString *, NSObject *> *> *
)payload
completion:(nullable VIMessengerCompletion<VIMessageEvent *> *
)completion
Sends text and payload changes to the cloud.
The participant that calls this method should have:
- the [VIConversationParticipant canEditMessages] permission to update its own messages
- the [VIConversationParticipant canEditAllMessages] permission to update other participants' messages
To get the method call result use one of the following options:
- Specify the completion parameter to consume the results with VIMessageEvent or VIErrorEvent in case of success/error accordingly.
- 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