CallClient

@available(iOS 12.0, *)
@objc(BDKCallClient)
public protocol CallClient : NSObjectProtocol

The client responsible for connecting and maintaining a connection with the Kaleyra Video call services.

Once started, the object will connect and keep the connection with Kaleyra Video platform, communicating and exchanging events with the servers.

State

  • A property holding the current state of the client.

    Declaration

    Swift

    var state: CallClientState { get }

State observers

  • Adds a CallClientObserver, 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: CallClientObserver)

    Parameters

    observer

    The observer to be added.

  • Adds a CallClientObserver 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: CallClientObserver, 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 CallClientObserver 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: CallClientObserver)

    Parameters

    observer

    The observer to be removed.

Incoming calls observers

  • Adds an IncomingCallObserver notified about incoming calls received.

    Important

    The observer will be notified synchronously on a private background queue. The observer object will be held weakly.

    Declaration

    Swift

    @objc(addIncomingCallObserver:)
    func addIncomingCall(observer: IncomingCallObserver)

    Parameters

    observer

    The observer to be added.

  • Adds an IncomingCallObserver 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(addIncomingCallObserver:queue:)
    func addIncomingCall(observer: IncomingCallObserver, 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 IncomingCallObserver observer.

    Once removed the observer will not receive incoming calls received notifications anymore unless it is added once again.

    Declaration

    Swift

    @objc(removeIncomingCallObserver:)
    func removeIncomingCall(observer: IncomingCallObserver)

    Parameters

    observer

    The observer to be removed.