CallKitProviderConfigurationBuilder

@available(iOS 12.0, *)
public class CallKitProviderConfigurationBuilder

A builder that helps you customise the CallKit user interface.

This object helps you customising the CallKit user interface guiding you in this process with a fluent interface. You use this object while configuring the Kaleyra Video SDK integration with CallKit.

 callkit.enabled { providerConfig in
                   providerConfig.supportedHandles([.phoneNumber, .emailAddress])
                                 .ringtoneSound("my ringtone.mp3")
                                 .icon(UIImage(named: "callkit.png")!)
 }

Remark

This builder is suited and available only for Swift code. If your application is written in Objective-c, you should use the BDKCallKitProviderConfigurationBuilder instead.
  • Creates a new builder instance

    Declaration

    Swift

    public convenience init()

Ringtone

  • Call this method when you want to provide a ringtone sound different from the default system ringtone.

    Declaration

    Swift

    @discardableResult
    public func ringtoneSound(_ sound: String) -> CallKitProviderConfigurationBuilder

    Parameters

    sound

    The name of the sound resource in the app bundle to be used as ringtone when a call is received

    Return Value

    self after storing the ringtone sound resource name.

Supported handles

  • Call this method when you want to setup the supported CXHandle.HandleType your app supports.

    Declaration

    Swift

    @discardableResult
    public func supportedHandles(_ handles: Set<CXHandle.HandleType>) -> CallKitProviderConfigurationBuilder

    Parameters

    handles

    A set containing the handle types supported by your app.

    Return Value

    self after storing your app supported handle types set.

  • Call this method when you want to setup the supported CXHandle.HandleType your app supports.

    This method ultimately calls the supportedHandles(_:) method

    Declaration

    Swift

    @discardableResult
    public func supportedHandles(_ handles: [CXHandle.HandleType]) -> CallKitProviderConfigurationBuilder

    Parameters

    handles

    An array containing the handle types supported by your app.

    Return Value

    self after storing your app supported handle types .

App icon

  • Call this method when you want to provide a custom icon to be shown in the system call UI interface.

    The icon image must be a square with side length of 40 points. The alpha channel of the image is used to create a white image mask.

    Beware, you should provide the image as png Data value, not an UIImage object. Take a look at UIImage.pngData function documentation for more info about transforming a png UIImage to a Data value.

    Declaration

    Swift

    @discardableResult
    public func iconData(_ data: Data) -> CallKitProviderConfigurationBuilder

    Parameters

    data

    The PNG data of a square 40x40 points image with alpha channel.

    Return Value

    self after storing the icon data.

  • Call this method when you want to provide a custom icon the be shown in the system call UI interface.

    The icon image must be a png square with side length of 40 points. The alpha channel of the image is used to create a white image mask.

    Declaration

    Swift

    @discardableResult
    public func icon(_ image: UIImage) -> CallKitProviderConfigurationBuilder

    Parameters

    image

    The UIImage to be displayed in system call UI interface

    Return Value

    self, after storing the icon image.