BandyerSDK

@available(iOS 12.0, *)
@objcMembers
public class BandyerSDK : NSObject

The Bandyer SDK facade.

Singleton instance

  • Returns the global singleton instance.

    Declaration

    Swift

    public private(set) static var instance: BandyerSDK { get }

Config

  • The configuration used by the module, provided in the configure method.

    Declaration

    Swift

    public var config: Bandyer.Config? { get }

Services

  • The call client instance.

    Warning

    Accessing this property while the SDK is not configured will crash your app!

    Declaration

    Swift

    public var callClient: Bandyer.CallClient! { get }
  • The call registry containing the calls currently being performed.

    Warning

    Accessing this property while the SDK is not configured will crash your app!

    Declaration

    Swift

    public var callRegistry: Bandyer.CallRegistry! { get }
  • The chat client instance.

    Warning

    Accessing this property while the SDK is not configured will crash your app!

    Declaration

    Swift

    public var chatClient: Bandyer.ChatClient! { get }

In-app Notifications

  • The in-app notifications coordinator instance.

    The service provided in this property is not started by default, you must call the start method on it explicitly in order to start receiving in-app notifications.

    Declaration

    Swift

    public var notificationsCoordinator: Bandyer.InAppNotificationsCoordinator? { get }

User Details provider

  • The user details provider instance that is going to be used whenever the SDK needs to show any user information like hers/his first name, last name and so on.

    Declaration

    Swift

    public var userDetailsProvider: Bandyer.UserDetailsProvider? { get set }

Configuration

  • Configure the module with the configuration object provided as arguments.

    Declaration

    Swift

    @objc(configure:)
    public func configure(_ config: Bandyer.Config)

    Parameters

    config

    The config object.

Connect / Disconnect

  • Connect a user session. It will also connect the SDK to Kaleyra Video back-end

    Declaration

    Swift

    @objc(connect:)
    public func connect(_ session: Bandyer.Session)

    Parameters

    session

    The session you want to connect.

  • Connect a user session. It will also connect the SDK to Kaleyra Video back-end

    Declaration

    Swift

    @objc(connect:completion:)
    public func connect(_ session: Bandyer.Session, completion: ((Error?) -> Void)?)

    Parameters

    session

    The session you want to connect.

    completion

    A callback that will be invoked if the connection process succeeds or if it encounters an error.

  • Closes any open session and stops any running client. You must call this method when you want to “logout” an user from your app.

    Declaration

    Swift

    public func disconnect()

VoIP Push notifications

  • Call this method when you receive a VoIP push notification and you want the sdk to handle it. You should call this method only when the automaticallyHandleVoIPNotifications flag is set to false.

    Declaration

    Swift

    @objc(handleNotification:)
    public func handleNotification(_ pushPayload: PKPushPayload)

    Parameters

    payload

    The payload of the VoIP push notification you received.

Verified user

  • Declaration

    Swift

    @objc(verifiedUser:forCall:completion:)
    public func verifiedUser(_ verified: Bool, for call: Bandyer.Call, completion: ((Error?) -> Void)?)

    Parameters

    verified

    A boolean flag indicating if the user is actually verified.

    call

    The call on which set verified the current logged user.

    completion

    A completion block called when the user verification response has been received. The completion block parameter will contain an error if an error occurred or nil on success. May be nil

Reset

  • Resets the module disconnecting the clients if they are connected

    Since

    3.8.0

    Declaration

    Swift

    public func reset()

Logging

  • This property sets the logging level for the module. If you want to turn on logging facilities you can set this value to one of the logging levels specified LogLevel enum (e.g. LogLevel.error, LogLevel.warning and so on…). If you want to turn off logging you can pass LogLevel.off value. The default value for this flag is LogLevel.off.

    Declaration

    Swift

    public static var logLevel: Bandyer.LogLevel { get set }
  • Use this property to change the loggers present during module execution. The default logger attached to module execution is Logger.console.

    Multiple loggers are supported, to add multiple loggers just type:

      BandyerSDK.loggers = [.console, .file]
    

    If Logger.file logger is added a log directory will be created and various log files will be written in that directory. To get log directory path type:

      let logPath = FileManager.default.urls(for: .cachesDirectory,
                                             in: .userDomainMask)
          .first?
          .appendingPathComponent("Logs")
    

    Remark

    If an empty set is provided no log statement will be printed, even if logging is enabled through BandyerSDK.logLevel property.

    Since

    3.10.0

    Declaration

    Swift

    public static var loggers: Bandyer.Logger { get set }