VIConversation

Interface that may be used to manage conversation.

Members
createdAt

UNIX timestamp that specifies the time of the conversation creation

@property (nonatomic, strong, readonly) NSNumber *createdAt
lastUpdate

UNIX timestamp that specifies the time of the last event in the conversation

@property (nonatomic, strong, readonly) NSNumber *lastUpdate
customData

Dictionary with custom data, up to 5kb.

@property (nonatomic, strong) NSDictionary *customData
distinct

Check if the conversation is distinct. If two conversations are created with same set of users and moderators and both have ‘distinct’ flag, second create call will fail with the UUID of conversation already created. Note that changing users or moderators list will clear ‘distinct’ flag. Note that setting this property does not send changes to the server. Use the update to send all changes at once.

@property (nonatomic, assign) BOOL distinct
publicJoin

Check if public join is enabled

@property (nonatomic, assign) BOOL publicJoin
lastRead

Sequence of last event that was read by user

@property (nonatomic, strong, readonly) NSNumber *lastRead
lastSeq

Last event sequence for this conversation.

@property (nonatomic, strong, readonly) NSNumber *lastSeq
uuid

Universally unique identifier of current conversation.

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

Current conversation title

@property (nonatomic, strong) NSString *title
participants

Array of VIConversationParticipant conversation participants alongside with their rights

@property (nonatomic, strong, readonly) NSArray<VIConversationParticipant*> *participants
moderators

Array of conversation moderator names

@property (nonatomic, strong, readonly) NSArray<NSString*> *moderators
–  addParticipants:

Add new participants to the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the [VIMessengerDelegate messenger:didEditConversation:] event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

- (void)addParticipants:(NSArray<VIConversationParticipant*> *)participants
Parameters
participants

Array of VIConversationParticipant to be added to the conversation

–  addModerators:

Add new moderators to the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the [VIMessengerDelegate messenger:didEditConversation:] event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

- (void)addModerators:(NSArray<NSString*> *)moderators
Parameters
moderators

Array of moderators to be added to the conversation

–  editParticipants:

Edit participants' access rights. Duplicated users are ignored. Participant list must contain all participants. Triggers the [VIMessengerDelegate messenger:didEditConversation:] event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

- (void)editParticipants:(NSArray<VIConversationParticipant*> *)participants
Parameters
participants
–  removeParticipants:

Remove participants from the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the [VIMessengerDelegate messenger:didEditConversation:] event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

- (void)removeParticipants:(NSArray<VIConversationParticipant*> *)participants
Parameters
participants

Array of VIConversationParticipant to be removed from conversation

–  removeModerators:

Remove moderators from the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the [VIMessengerDelegate messenger:didEditConversation:] event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.

- (void)removeModerators:(NSArray<NSString*> *)moderators
Parameters
moderators

Array of moderators to be removed from the conversation

–  markAsRead:

Mark the event with the specified sequence as ‘read’. This affects ‘lastRead’ and is used to display unread messages and events.

- (void)markAsRead:(NSNumber *)seq
Parameters
seq

Sequence number of the event to be marked as read

–  markAsDelivered:

Mark event with the specified sequence as handled by current logged-in device. If single user is logged in on multiple devices, this can be used to display delivery status.

- (void)markAsDelivered:(NSNumber *)seq
Parameters
seq

Sequence number of the event to be marked as delivered

–  sendMessage:payload:

Send message to the conversation. Triggers the [VIMessengerDelegate messenger:didSendMessage:] event for all messenger objects on all clients, including this one.

- (VIMessage *)sendMessage:(NSString *)message payload:(NSArray<VIPayload*> *)payload
Parameters
message

Message text

payload

Message payload

Return

VIMessage instance

–  typing

Calling this method will inform backend that user is typing some text. Calls within 10s interval from the last call are discarded.

- (void)typing
–  retransmitEventsFrom:to:

Request events in the specified sequence range to be sent from server into this client. Used to get history or get missed events in case of network disconnect. Please note that server will not push any events that was missed due to the client being offline. Client should use this method to request all events based on the last event sequence received from the server and last event sequence saved locally (if any).

- (void)retransmitEventsFrom:(NSNumber *)from to:(NSNumber *)to
Parameters
from

First event in range sequence, inclusive

to

Last event in range sequence, inclusive

–  update

Send conversation changes to the server. The changes sent are: title, public join flag, distinct flag and custom data.

- (void)update
–  remove

Remove current conversation. All participants, including this one, will receive the [VIMessengerDelegate messenger:didRemoveConversation:] event.

- (void)remove