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 }
-
The delegate that provides hidden pre-chat field values.
Declaration
Objective-C
@property (nonatomic, weak) id<SMIHiddenPreChatDelegate> _Nullable preChatDelegate;
Swift
weak var preChatDelegate: HiddenPreChatDelegate? { get set }
-
The delegate that provides the auto-response messaging component parameter values.
Declaration
Objective-C
@property (nonatomic, weak) id<SMITemplatedUrlDelegate> _Nullable templatedUrlDelegate;
Swift
weak var templatedUrlDelegate: TemplatedUrlDelegate? { get set }
-
The delegate that provides the challenge for the identity token for user verified connections.
Declaration
Objective-C
@property (nonatomic, weak) id<SMIUserVerificationDelegate> _Nullable userVerificationDelegate;
Swift
weak var userVerificationDelegate: UserVerificationDelegate? { get set }
-
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.
-
Sets the templatedUrlDelegate while also defining the dispatch queue that events fired to this delegate will be emitted to. 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)setTemplatedUrlDelegate: (nonnull id<SMITemplatedUrlDelegate>)templatedUrlDelegate queue:(nonnull dispatch_queue_t)queue;
Swift
func setTemplatedUrlDelegate(delegate templatedUrlDelegate: TemplatedUrlDelegate, queue: DispatchQueue)
Parameters
templatedUrlDelegate
The delegate to add.
queue
The dispatch queue to listen for events.
-
Sets the preChatDelegate while also defining the dispatch queue that events fired to this delegate will be emitted to. 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)setPreChatDelegate: (id<SMIHiddenPreChatDelegate> _Nullable)preChatDelegate queue:(nonnull dispatch_queue_t)queue;
Swift
func setPreChatDelegate(delegate preChatDelegate: HiddenPreChatDelegate?, queue: DispatchQueue)
Parameters
preChatDelegate
The delegate to add.
queue
The dispatch queue to listen for events.
-
Sets the userVerificationDelegate while also defining the dispatch queue that events fired to this delegate will be emitted to. 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)setUserVerificationDelegate: (nonnull id<SMIUserVerificationDelegate>)userVerificationDelegate queue:(nonnull dispatch_queue_t)queue;
Swift
func setUserVerificationDelegate(delegate userVerificationDelegate: UserVerificationDelegate, queue: DispatchQueue)
Parameters
userVerificationDelegate
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. This will reset all conversation as well as authorization credentials.
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.
-
De-registers the device from receiving push notifications.
Declaration
Objective-C
- (void)deregisterDeviceWithCompletion: (nullable SMIDataOperationCompletion)completion;
Swift
func deregisterDevice() async throws
Parameters
completion
Returns the result of the operation. If error is nil, the request is successful.
-
Revokes the authorization credentials associated with this configuration and optionally de-registers the device from receiving push notifications.
Declaration
Objective-C
- (void)revokeTokenAndDeregisterDevice:(BOOL)deregisterDevice completion: (nullable SMIDataOperationCompletion)completion;
Swift
func revokeTokenAndDeregisterDevice(_ deregisterDevice: Bool) async throws
Parameters
deregisterDevice
Whether or not to also de-register device from push notifications.
completion
Returns the result of the operation. If error is nil, the request is successful.
-
Revokes the authorization credentials associated with this configuration and de-registers the device from receiving push notifications.
Note
This method automatically de-registers the device from receiving push notifications. If you don’t want to de-register the device, use-revokeTokenAndDeregisterDevice:completion:
and setderegisterDevice
tofalse
.Declaration
Objective-C
- (void)revokeTokenWithCompletion: (nullable SMIDataOperationCompletion)completion;
Swift
func revokeToken() async throws
Parameters
completion
Returns the result of the operation. If error is nil, the request is successful.