SMIConversationClientDelegate
Objective-C
@protocol SMIConversationClientDelegate <NSObject>
Swift
protocol ConversationClientDelegate : NSObjectProtocol
Delegate that handles events related to a conversation.
-
Deprecated
Will be removed in a future version. Use
-client:didReceiveEntries:paged:
instead.Delegate event that is triggered when an entry has been added to a conversation. This fires for both inbound and outbound entries.
The subject on the sender can be checked to determine whether a message was sent by a local participant.
Outbound entries are echoed back on this event due to the chance it could be modified by any configured sensitive data rules. This event is also an acknowledgement that the message has been cached locally.
The best practice, if choosing to display outgoing entries, is to wait for this event rather than displaying entries directly.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didReceiveEntry:(nonnull id<SMIConversationEntry>)entry;
Swift
optional func client(_ client: any SMIConversationClient, didReceive entry: any SMIConversationEntry)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.entry
The
SMIConversationEntry
data model which represents an incoming/outgoing message. -
Delegate event that is triggered when entries have been added to a conversation. This fires for both inbound and outbound entries.
The subject on the sender can be checked to determine whether a specific entry was sent by a local participant.
Outbound entries are echoed back on this event due to the chance it could be modified by any configured sensitive data rules. This event is also an acknowledgement that the entries have been cached locally.
The best practice, if choosing to display outgoing entries, is to wait for this event rather than displaying entries directly.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didReceiveEntries:(nonnull NSArray<id<SMIConversationEntry>> *)entries paged:(BOOL)paged;
Swift
optional func client(_ client: any SMIConversationClient, didReceiveEntries entries: [any SMIConversationEntry], paged: Bool)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.entries
The array of
SMIConversationEntry
data models. Each entry represents an incoming/outgoing message.paged
Indicates whether this event was fired as a result of a database paging request. These entries are a result of requesting additional or missing entries from the local database populated from the service.
-
Deprecated
Will be removed in a future version. Use
-client:didUpdateEntries:
instead.Delegate event that is triggered when a message’s status has been updated. It is recommended that any current references to an entry with a matching ID are refreshed. It is possible for entries to change type entirely due to backend translation, and any consuming UI should account for that.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didUpdateEntry:(nonnull id<SMIConversationEntry>)entry;
Swift
optional func client(_ client: any SMIConversationClient, didUpdate entry: any SMIConversationEntry)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.entry
The
SMIConversationEntry
data model that represents an incoming/outgoing message. -
Delegate event that is triggered when a message’s status has been updated. It is recommended that any current references to an entry with a matching ID are refreshed. It is possible for entries to change type entirely due to backend translation, and any consuming UI should account for that.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didUpdateEntries:(nonnull NSArray<id<SMIConversationEntry>> *)entries;
Swift
optional func client(_ client: any SMIConversationClient, didUpdateEntries entries: [any SMIConversationEntry])
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.entries
The array of
SMIConversationEntry
data models. Each entry represents an incoming/outgoing message. -
Delegate event that is triggered when the active participants on a conversation have changed.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didUpdateActiveParticipants: (nonnull NSArray<id<SMIParticipant>> *)activeParticipants;
Swift
optional func client(_ client: any SMIConversationClient, didUpdateActiveParticipants activeParticipants: [any SMIParticipant])
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.activeParticipants
The array of active
SMIParticipant
data models. -
Delegate event that is triggered when receiving a typing started event from another participant.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didReceiveTypingStartedEvent:(nonnull id<SMIConversationEntry>)event;
Swift
optional func client(_ client: any SMIConversationClient, didReceiveTypingStartedEvent event: any SMIConversationEntry)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.event
The
SMIConversationEntry
which contains the typing event as a payload. -
Delegate event that is triggered when receiving a typing stopped event from another participant.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didReceiveTypingStoppedEvent:(nonnull id<SMIConversationEntry>)event;
Swift
optional func client(_ client: any SMIConversationClient, didReceiveTypingStoppedEvent event: any SMIConversationEntry)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.event
The
SMIConversationEntry
which contains the typing event as a payload. -
Delegate event that is triggered by the creation of a conversation for the conversationId associated with the client.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didCreateConversation:(nonnull id<SMIConversation>)conversation;
Swift
optional func client(_ client: any SMIConversationClient, didCreateConversation conversation: any SMIConversation)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.conversation
The
SMIConversation
object which represents the newly created conversation. -
Delegate event that is triggered if an unhandled error is detected as part of the normal activity of the In-App Messaging client.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didError:(nonnull NSError *)error;
Swift
optional func client(_ client: any SMIConversationClient, didError error: any Error)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.error
The
NSError
which triggered this event. -
Delegate event that is triggered when the conversation is updated.
Declaration
Objective-C
- (void)client:(nonnull id<SMIConversationClient>)client didUpdateConversation:(nonnull id<SMIConversation>)conversation;
Swift
optional func client(_ client: any SMIConversationClient, didUpdate conversation: any SMIConversation)
Parameters
client
The
SMIConversationClient
instance that is managing the current connection.conversation
The conversation.