CallWindow

@objc(BDKCallWindow)
public class CallWindow : UIWindow
extension CallWindow: CallViewControllerDelegate

A UIWindow subclass having a BDKCallViewControllerinstance as its rootViewController.

  • The window unique instance.

    Declaration

    Swift

    @objc
    public private(set) weak static var instance: CallWindow? { get }
  • The window’s delegate.

    Declaration

    Swift

    @objc
    public weak var callDelegate: CallWindowDelegate?
  • The intent used to start the BDKCallViewController.

    Declaration

    Swift

    @objc
    public private(set) var intent: BDKIntent? { get }

Initialization

  • Initialize a CallWindow instance.

    Warning

    Init the window only one at a time, otherwise a fatal error is thrown.

    Declaration

    Swift

    @objc
    public convenience init()

Presentation

  • Presents a BDKCallViewController as its root view controller. If there is already another active call being handled an error will be raised and reported in the completion block provided as second argument.

    Declaration

    Swift

    @available(*, deprecated, message: "Use presentCallViewController(for:completion:﹚ method instead.")
    @objc
    public func shouldPresentCallViewController(intent: BDKIntent?, completion: @escaping (Bool) -> Void)

    Parameters

    intent

    The intent object to be handled by the receiver.

    completion

    The completion called at the end of the method job. Returns true if the presentation will start, otherwise returns false.

  • Presents a BDKCallViewController as its root view controller. If there is already another active call being handled an error will be raised and reported in the completion block provided as second argument.

    Declaration

    Swift

    @objc
    public func presentCallViewController(for intent: BDKIntent, completion: ((Error?) -> Void)? = nil)

    Parameters

    intent

    The intent object to be handled by the receiver.

    completion

    The completion called at the end of the method job. Returns no error if the presentation will start, otherwise returns an error of type BDKCallPresentationError.

Dismissal

Configuration

  • Sets the call view controller configuration to be used.

    Remark

    The configuration argument provided is copied.

    Throws

    throws an NSInternalInconsistencyException if this method is called after the view has been loaded.

    Declaration

    Swift

    @objc
    public func setConfiguration(_ configuration: CallViewControllerConfiguration?)

    Parameters

    configuration

    The call view controller configuration to be used.

SiriKit intents handling

  • Handles a Siri INStartVideoCallIntent. This intent is going to be provided by the system when CallKit is enabled and the user taps on the video button in the system call UI. In order to handle the request from the user you must send the intent received to the window.

    Declaration

    Swift

    @available(iOS, introduced: 10.0, deprecated: 13.0, message: "handle(startVideoCallIntent:﹚ is deprecated. Please use handle(startCallIntent:﹚ instead")
    @objc(handleINStartVideoCallIntent:)
    public func handle(startVideoCallIntent intent: INStartVideoCallIntent)

    Parameters

    intent

    The INStartVideoCallIntent received in your AppDelegate.

  • Handles a Siri INStartCallIntent. This intent is going to be provided by the system when CallKit is enabled and the user taps on the video button in the system call UI. In order to handle the request from the user you must send the intent received to the window.

    Declaration

    Swift

    @available(iOS 13.0, *)
    @objc(handleINStartCallIntent:)
    public func handle(startCallIntent intent: INStartCallIntent)

    Parameters

    intent

    The INStartCallIntent received in your AppDelegate.