Class

CXCallController

A programmatic interface for interacting with and observing calls.

Overview

A CXCallController object interacts with calls by performing actions, which are represented by instances of CXCallAction subclasses. You can request that one or more actions be performed in a single CXTransaction object using the request(_:completion:) method. A transaction may be rejected by the system for one of the reasons listed in the CXErrorCodeRequestTransactionError.Code enumeration.

Each CXCallController object manages a CXCallObserver object, which can be accessed using the callObserver property. You can provide an object conforming to the CXCallObserverDelegate protocol to the call observer in order to be notified of any changes to active calls.

Topics

Creating New Call Controllers

init()

Initializes a new call controller with a private, serial queue, which is used for calling completion blocks.

init(queue: DispatchQueue)

Initializes a new call controller with a specified queue, which is used for calling completion blocks.

Accessing the Call Observer

var callObserver: CXCallObserver

Returns an observer for active calls.

Requesting Transactions

func request(CXTransaction, completion: (Error?) -> Void)

Requests that the actions in the specified transaction be asynchronously performed by the telephony provider.

func requestTransaction(with: CXAction, completion: (Error?) -> Void)

Requests that the transaction that contains the specified action be asynchronously performed by the telephony provider.

func requestTransaction(with: [CXAction], completion: (Error?) -> Void)

Requests that the transaction that contains the specified actions be asynchronously performed by the telephony provider.

Errors

enum CXErrorCodeRequestTransactionError.Code

Error codes for the CallKit Constants error domain.

let CXErrorDomainRequestTransaction: String

Domain for errors when requesting a transaction from a call controller. See CallKit Constants for possible error codes.

Relationships

Inherits From

Conforms To

See Also

Outgoing Calls

class CXTransaction

An object that contains zero or more action objects to be performed by a call controller.

class CXStartCallAction

An encapsulation of the act of initiating an outgoing call.