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 forSwift 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()
-
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) -> CallKitProviderConfigurationBuilderParameters
soundThe 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.
-
Call this method when you want to setup the supported
CXHandle.HandleTypeyour app supports.Declaration
Swift
@discardableResult public func supportedHandles(_ handles: Set<CXHandle.HandleType>) -> CallKitProviderConfigurationBuilderParameters
handlesA 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.HandleTypeyour app supports.This method ultimately calls the
supportedHandles(_:)methodDeclaration
Swift
@discardableResult public func supportedHandles(_ handles: [CXHandle.HandleType]) -> CallKitProviderConfigurationBuilderParameters
handlesAn array containing the handle types supported by your app.
Return Value
self after storing your app supported handle types .
-
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
Datavalue, not an UIImage object. Take a look atUIImage.pngDatafunction documentation for more info about transforming a pngUIImageto aDatavalue.Declaration
Swift
@discardableResult public func iconData(_ data: Data) -> CallKitProviderConfigurationBuilderParameters
dataThe 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) -> CallKitProviderConfigurationBuilderParameters
imageThe
UIImageto be displayed in system call UI interfaceReturn Value
self, after storing the icon image.
View on GitHub
CallKitProviderConfigurationBuilder Class Reference