VoIPPushConfigurationBuilder

@available(iOS 12.0, *)
public class VoIPPushConfigurationBuilder

A builder that helps creating the VoIP push notifications configuration used by the Kaleyra Video SDK.

 let config = try ConfigBuilder(appID: "my app id", environment: .production, region: .europe)
                  .voip { voip in
                          voip.automatic(pushRegistryDelegate: self)
                  }.build()

This object helps you setting up the Kaleyra Video SDK VoIP notifications configuration guiding you in this process with a fluent interface. The Kaleyra Video SDK supports two VoIP notifications handling strategies: automatic meaning the SDK will handle the VoIP notifications without the app intervention and manual, meaning your app must handle incoming VoIP notifications and hand them to the SDK.

Remark

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

    Declaration

    Swift

    public init()
  • Call this method when you want to handle VoIP notifications yourself.

    Important

    When you receive a VoIP notification and you want the SDK to handle the push notification payload, you must call the BandyerSDK.handleNotification(_:) method

    Declaration

    Swift

    public func manual(payloadKeyPath keypath: String? = nil)

    Parameters

    payloadKeyPath

    The keypath the SDK will search for the Kaleyra Video notification payload in the push notification received from APNS. If you provide a value the SDK will use that value as a key path to search for the call information in the VoIP notification, otherwise if you specify nil, the SDK will try to search for the call information in the VoIP notification by itself

  • Call this method when you want the Kaleyra Video SDK to handle VoIP notifications automatically.

    Declaration

    Swift

    public func automatic(pushRegistryDelegate delegate: PKPushRegistryDelegate,
                          listenForNotificationsInForeground foreground: Bool = false,
                          payloadKeyPath keypath: String? = nil)

    Parameters

    pushRegistryDelegate

    An object conforming to the PKPushRegistryDelegate protocol that will be notified when the VoIP push token has been updated.

    listenForNotificationsInForeground

    A boolean flag indicating whether you want the SDK to handle VoIP push notifications even when the application is in foreground. When this parameter is false, the SDK will listen for notifications when the application is in background but NOT when the application is in foreground. When this parameter is true, the SDK will listen for notifications when the application is in background and when it is in foreground. The default value of this parameter is false.

    payloadKeyPath

    The keypath the SDK will search for the Kaleyra Video notification payload in the push notification received from APNS. If you provide a value the SDK will use that value as a key path to search for the call information in the VoIP notification, otherwise if you specify nil, the SDK will try to search for the call information in the VoIP notification by itself