CallClientObserver
@available(iOS 12.0, *)
@objc(BDKCallClientObserver)
public protocol CallClientObserver : NSObjectProtocol
An observer of a call client object.
You subscribe as a CallClientObserver when you want to react about CallClient object state changes.
You are required to implement at least the callClientDidChangeState(_:oldState:newState:) method invoked after the CallClient has changed its state
-
An optional method invoked when the
CallClientis about to change its state.Implement this method when you want to react before the
CallClientchange its internal state. This method provides the current state of the client and the new state the client will transition to.Important
If you subscribe as an asynchronous observer, the current state you are going to get from the client parameter won’t match the value from the
currentStateparameterDeclaration
Swift
@objc(callClientWillChangeState:oldState:newState:) optional func callClientWillChangeState(_ client: CallClient, oldState: CallClientState, newState: CallClientState)Parameters
clientThe chat client object.
oldStateThe state the chat client is about to leave.
newStateThe state the chat client is about to transition to.
-
A method invoked when the
CallClientchanged its state.Implement this method when you want to react after the
CallClientchanged its internal state. This method provides the new state the client has transitioned to and the old state the client was in before the transition occurred.Declaration
Swift
@objc(callClientDidChangeState:oldState:newState:) func callClientDidChangeState(_ client: CallClient, oldState: CallClientState, newState: CallClientState)Parameters
clientThe chat client object.
oldStateThe state the chat client was in before the transition occurred.
newStateThe state the chat client transitioned to.
-
An optional method invoked when the
CallClienthas failed.Implement this method when you want to react after the
CallClienthas failed, getting the cause of the failure as a method parameter.Declaration
Swift
@objc(callClient:didFailWithError:) optional func callClient(_ client: CallClient, didFailWithError error: Error)Parameters
clientThe chat client object.
errorThe error occurred.
View on GitHub
CallClientObserver Protocol Reference