SMICoreDelegate
Objective-C
@protocol SMICoreDelegate <NSObject>
Swift
protocol CoreDelegate : NSObjectProtocol
Delegate used to receive events for the SMICoreClient
framework. Use this protocol to listen
for chat messages, receive message status changes, detect network status changes, and receive error messages.
See
SMICoreClient
-
Deprecated
Will be removed in a future version. Use
-core:conversation: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)core:(id<SMICoreClient>)core didReceiveEntry:(id<SMIConversationEntry>)entry;
Parameters
core
The
SMICoreClient
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)core:(id<SMICoreClient>)core conversation:(id<SMIConversation>)conversation didReceiveEntries:(NSArray<id<SMIConversationEntry>> *)entries paged:(BOOL)paged;
Parameters
core
The
SMICoreClient
instance that is managing the current connection.conversation
The
SMIConversation
instance that owns the emitted entries.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
-core:conversation: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)core:(id<SMICoreClient>)core didUpdateEntry:(id<SMIConversationEntry>)entry;
Parameters
core
The
SMICoreClient
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)core:(id<SMICoreClient>)core conversation:(id<SMIConversation>)conversation didUpdateEntries:(NSArray<id<SMIConversationEntry>> *)entries;
Parameters
core
The
SMICoreClient
instance that is managing the current connection.conversation
The
SMIConversation
instance that owns the emitted entries.entries
The array of
SMIConversationEntry
data models. Each entry represents an incoming/outgoing message. -
Delegate event that is triggered when receiving a typing started event from another participant.
Declaration
Objective-C
- (void)core:(id<SMICoreClient>)core didReceiveTypingStartedEvent:(id<SMIConversationEntry>)event;
Parameters
core
The
SMICoreClient
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)core:(id<SMICoreClient>)core didReceiveTypingStoppedEvent:(id<SMIConversationEntry>)event;
Parameters
core
The
SMICoreClient
instance that is managing the current connection.event
The
SMIConversationEntry
which contains the typing event as a payload. -
Delegate event that is triggered by a change in the status of the network. Based on the status change, you can decide how to convey this information to the UI.
Declaration
Objective-C
- (void)core:(id<SMICoreClient>)core didChangeNetworkState:(SMINetworkConnectivityState)state;
Parameters
core
The
SMICoreClient
instance that is managing the current connection.state
The current
SMINetworkConnectivityState
status of the network -
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)core:(id<SMICoreClient>)core didError:(NSError *)error;
Parameters
core
The
SMICoreClient
instance that is managing the current connection.error
The
NSError
which triggered this event. -
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)core:(id<SMICoreClient>)core didCreateConversation:(id<SMIConversation>)conversation;
Parameters
core
The
SMICoreClient
instance that is managing the current connection.conversation
The conversation