ConnectionProvider
@objc(ZDKConnectionProvider)
public final class ConnectionProvider : NSObject
ZDKConnectionProvider gives the ability to observe connection updates.
-
The current status of the Connection
Declaration
Swift
@objc public var status: ConnectionStatus { get } -
Connect to the session
Declaration
Swift
@objc public func connect() -
Disconnect from the current session, closes the socket connection. Please note, this won’t end the chat session with agent
Declaration
Swift
@objc public func disconnect() -
Observe connection status updates. Specify a closure how the status should be handled
Declaration
Swift
public func observeConnectionStatus(identifier: ObservableIdentifier = .uuid(), _ completion: @escaping (ConnectionStatus) -> Void) -> ObservationTokenParameters
identifierObservableIdentifier to be exclusive, or unique
completionSpecify how to handle the
ConnectionStatusvia closure.Return Value
An
ObservationTokenthat can cancel the subscription to theConnectionStatus.
Install in Dash
ConnectionProvider Class Reference