ChatClient
@available(iOS 12.0, *)
@objc(BDKChatClient)
public protocol ChatClient : NSObjectProtocol
The client responsible for connecting and maintaining a connection with the Kaleyra Video chat service.
-
A property holding the current state of the client.
Declaration
Swift
var state: ChatClientState { get }
-
Adds a
ChatClientObserver
, notified about changes in the state of the client.Important
The observer will be notified synchronously on a private background queue. The observer object will be held weakly.Declaration
Swift
@objc(addObserver:) func add(observer: ChatClientObserver)
Parameters
observer
The observer to be added.
-
Adds a
ChatClientObserver
specifying on which dispatch queue it must be notified.When a nil queue is provided the observer will be notified synchronously on a private background queue. Otherwise the observer will be notified asynchronously on the queue provided.
Important
The observer will be held weakly.Declaration
Swift
@objc(addObserver:queue:) func add(observer: ChatClientObserver, queue: DispatchQueue?)
Parameters
observer
The observer to be added
queue
The dispatch queue onto which the observer will be notified when an event occurs.
-
Removes a
ChatClientObserver
observer.Once removed the observer will not receive client state change notifications anymore unless it is added once again.
Declaration
Swift
@objc(removeObserver:) func remove(observer: ChatClientObserver)
Parameters
observer
The observer to be removed.