ConfigBuilderObjcAdapter

@available(iOS 12.0, *)
@objc(BDKConfigBuilder)
public class ConfigBuilderObjcAdapter : NSObject

A builder that constructs Kaleyra Video SDK Config objects.

This object helps you creating Config objects guiding you in this process with a fluent interface. The only required parameters are the appID, the environment and the region values. You must provide those values in the builder create factory block, then you can use the builder methods to enable or disable tools and other SDK features.

 BDKConfig *config = BDKConfigBuilder.create(@"My app id", BDKEnvironmentSandbox, BDKRegionIndia)
                                      .callKit(^(BDKCallKitConfigurationBuilder * callkit) {
                                                  callkit.enabled();
                                      })
                                      .voip(^(BDKVoIPPushConfigurationBuilder * voip){
                                                  voip.manual(@"foo.bar");
                                      })
                                      .tools(^(BDKToolsConfigurationBuilder *tools){
                                                  tools.chat()
                                                       .fileshare()
                                                       .inAppScreensharing()
                                                       .whiteboard();
                                      })
                                      .disableDirectIncomingCalls()
                                      .hijackAudioRoute(BDKSpeakerHijackingStrategyNever)
                                      .build();

By default the builder will use some default values if you don’t override them by calling one of its methods. Here’s a list of the default values:

  • CallKit is enabled
  • VoIP notifications are NOT handled automatically, you must handle them yourself
  • All tools are disabled
  • Camera configuration has cameraPosition set to front
  • The SDK will listen for direct incoming calls coming from the WebSocket connection
  • TheSpeakerHijackingStrategy is SpeakerHijackingStrategy.videoForeground.

    Remark

    This builder is suited for Objective-ccode. If your application is written in Swift, you should use the ConfigBuilder instead.
  • Call this property when you want to provide a block configuring the SDK CallKit integration.

      BDKConfig *config = BDKConfigBuilder.create(@"My app id", BDKEnvironmentSandbox, BDKRegionIndia)
                                          .callKit(^(BDKCallKitConfigurationBuilder * callkit) {
                                                      callkit.enabled();
                                          }).build();
    

    Call this block when you want to override CallKit configuration default values.

    The block expects a block taking a CallKitConfigurationBuilderObjcAdapter object as parameter and returns self after setting the value provided as argument.

    Declaration

    Swift

    @objc
    public var callKit: ((CallKitConfigurationBuilderObjcAdapter) -> Void) -> ConfigBuilderObjcAdapter { get }
  • Call this property when you want to provide a block configuring the SDK VoIP push configuration.

      BDKConfig *config = BDKConfigBuilder.create(@"My app id", BDKEnvironmentSandbox, BDKRegionIndia)
                                          .voip(^(BDKVoIPPushConfigurationBuilder * voip) {
                                                  voip.manual(@"foo.bar");
                                          }).build();
    

    A block that will let you specify VoIP push configuration values. Call this block when you want to setup how the Kaleyra Video SDK should manage VoIP push notifications.

    The block expects a block taking a VoIPPushConfigurationBuilderObjcAdapter object as parameter and returns self after setting the value provided as argument.

    Declaration

    Swift

    @objc
    public var voip: ((VoIPPushConfigurationBuilderObjcAdapter) -> Void) -> ConfigBuilderObjcAdapter { get }
  • Call this property when you want to provide a block configuring the SDK tools.

      BDKConfig *config = BDKConfigBuilder.create(@"My app id", BDKEnvironmentSandbox, BDKRegionIndia)
                                          .tools(^(BDKToolsConfigurationBuilder *tools) {
                                                      tools.chat()
                                                           .fileshare()
                                                           .inAppScreensharing()
                                                           .whiteboard();
                                          }).build();
    

    A block that will let you specify the configuration for the Kaleyra Video tools. Call this block when you want to setup the Kaleyra Video SDK tools.

    The block expects a block taking a ToolsConfigurationBuilderObjcAdapter object as parameter and returns self after setting the value provided as argument.

    Declaration

    Swift

    @objc
    public var tools: ((ToolsConfigurationBuilderObjcAdapter) -> Void) -> ConfigBuilderObjcAdapter { get }
  • Call this property when you want to provide a block configuring the SDK camera.

      BDKConfig *config = BDKConfigBuilder.create(@"My app id", BDKEnvironmentSandbox, BDKRegionIndia)
                                          .camera(^(BDKCameraConfigurationBuilder *camera) {
                                                      camera.withCameraPosition(BDKCameraPositionBack);
                                          }).build();
    

    A block that will let you specify the configuration for the Kaleyra Video camera. Call this block when you want to setup the Kaleyra Video SDK camera.

    The block expects a block taking a CameraConfigurationBuilderObjcAdapter object as parameter and returns self after setting the value provided as argument.

    Declaration

    Swift

    @objc
    public var camera: ((CameraConfigurationBuilderObjcAdapter) -> Void) -> ConfigBuilderObjcAdapter { get }
  • A block that will let you specify the strategy the Kaleyra Video will use to override the audio output to the speaker when a call starts. The option provided will be used only when the app is running on devices mounting an ear speaker and a loud speaker (iPhones). On devices not supporting ear speaker (iPads) this option has no effect.

    The block expects a SpeakerHijackingStrategy value as parameter and returns self after setting the value provided as argument.

    Declaration

    Swift

    @objc
    public var hijackAudioRoute: (SpeakerHijackingStrategy) -> ConfigBuilderObjcAdapter { get }
  • Call this property when you want the SDK to not listen for incoming calls coming from the WebSocket connection.

    The block returns self after disabling the incoming calls.

    Declaration

    Swift

    @objc
    public var disableDirectIncomingCalls: () -> ConfigBuilderObjcAdapter { get }
  • Call this block when you have finished setting up the tools and the features of the Kaleyra Video SDK and you want to create a Config object.

    The block doesn’t take any parameters and returns a Config object holding the configuration values you provided to the builder.

    Declaration

    Swift

    @objc
    public var build: () -> Config { get }
  • Creates a new instance of the builder that will help you out building a Kaleyra Video Config object.

    You are required to provide a appID, environment, region triplet identifying your app in the Kaleyra Video platform. Beware, the appID is bound to an environment and a region, if you provide a wrong environment or region value the Kaleyra Video won’t be able to connect to the back-end.

    The block expects three parameters and returns a newly constructed builder. Parameters:

    • appID: The appID identifying your app in the Kaleyra Video
    • environment: Kaleyra Video back-end environment where the SDK will connect to (e.g production, sandbox).
    • region: The global region where user’s data will be conserved and managed.

    Declaration

    Swift

    @objc
    public static var create: (String, Bandyer.Environment, Bandyer.Region) -> ConfigBuilderObjcAdapter { get }