SMICoreClient
Objective-C
@protocol SMICoreClient
Swift
protocol CoreClient
Main entry point for the In-App Messaging core API. To create an instance of this class, use the SMICoreFactory
class and provide an SMICoreConfiguration
object.
-
Configuration used to determine where to send and receive events for the In-App Messaging service.
Declaration
Objective-C
@property (nonatomic, copy, readonly) SMICoreConfiguration *_Nonnull configuration;
Swift
@NSCopying var configuration: SMICoreConfiguration { get }
-
Current network connectivity state.
Declaration
Objective-C
@property (nonatomic, strong, readonly, getter=state) SMINetworkConnectivityState _Nonnull state;
Swift
var state: NetworkConnectivityState { get }
-
Generates an instance of a
SMIConversationClient
object which is used to manage all conversation data.Declaration
Objective-C
- (nonnull id<SMIConversationClient>)conversationClientWithId: (nullable NSUUID *)conversationId;
Parameters
conversationId
The conversation ID associated with this
SMIConversationClient
instance. Ifnil
, a UUID is used. -
Starts listening for remote events.
Declaration
Objective-C
- (void)start;
Swift
func start()
-
Stops listening to remote events.
Declaration
Objective-C
- (void)stop;
Swift
func stop()
-
Retrieves the current remote configuration if available. Defaults to offline backups if the current configuration cannot be retrieved.
Declaration
Objective-C
- (void)retrieveRemoteConfigurationWithCompletion: (nonnull SMIRemoteConfigurationCompletion)completion;
Swift
func retrieveRemoteConfiguration() async throws -> RemoteConfiguration
Parameters
completion
Contains a reference to an
SMIRemoteConfiguration
object if successful, or anNSError
describing the failure. -
Marks a conversation entry as read.
Note
Only messages from remote participants should be provided. If the participant on the entry is local, this results in a no-op.Declaration
Objective-C
- (void)markAsRead:(nonnull id<SMIConversationEntry>)entry;
Swift
func markAsRead(entry: ConversationEntry)
Parameters
entry
The entry to mark as read.
-
Attempts to retry a message delivery. If the message status is not
SMIConversationEntryStatusError
, the entry is ignored.Declaration
Objective-C
- (void)retryEntry:(nonnull id<SMIConversationEntry>)entry;
Swift
func retry(_ entry: ConversationEntry)
Parameters
entry
The message to attempt to retry.
-
Adds a delegate to listen to
SMICoreDelegate
events.Declaration
Objective-C
- (void)addDelegate:(nonnull id<SMICoreDelegate>)delegate;
Swift
func addDelegate(delegate: CoreDelegate)
Parameters
delegate
The delegate to add.
-
Adds a delegate to listen to
SMICoreDelegate
events. It is recommended that the main queue is passed to this method if you plan to handle events directly with changes to the UI.Declaration
Objective-C
- (void)addDelegate:(nonnull id<SMICoreDelegate>)delegate queue:(nonnull dispatch_queue_t)queue;
Swift
func addDelegate(delegate: CoreDelegate, queue: DispatchQueue)
Parameters
delegate
The delegate to add.
queue
The dispatch queue to listen for events.
-
Removes the delegate to stop receiving events.
Declaration
Objective-C
- (void)removeDelegate:(nonnull id<SMICoreDelegate>)delegate;
Swift
func removeDelegate(delegate: CoreDelegate)
Parameters
delegate
The delegate to remove.
-
Deletes the In-App Message store.
Declaration
Objective-C
- (void)destroyStorage:(nonnull SMIDataOperationCompletion)completion;
Swift
func destroyStorage() async throws
Parameters
completion
Completion block that returns with the success or failure of the operation.