BandyerSDK

Objective-C

@interface BandyerSDK : NSObject

Swift

class BandyerSDK : NSObject

The Bandyer SDK facade.

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 BDKLogLevel enum (e.g. BDKLogLevelError, BDKLogLevelWarning and so on…). If you want to turn off logging you can pass BDKLogLevelOff value. The default value for this flag is BDKLogLevelOff.

    Declaration

    Objective-C

    @property (class, nonatomic) BDKLogLevel logLevel;

    Swift

    class var logLevel: LogLevel { get set }

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

    Objective-C

    @property (nonatomic, strong, readonly, nullable) id<BDKInAppNotificationsCoordinator> notificationsCoordinator;

Config

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

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) BDKConfig *config;

    Swift

    @NSCopying var config: BDKConfig? { get }

Services

  • The call client instance.

    Throws: an NSInternalInconsistencyException is thrown when this property is accessed before the sdk is initialized.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) id<BDKCallClient> _Nonnull callClient;
  • Returns the call registry containing the calls currently being performed.

    Throws an NSInternalInconsistencyException is thrown when this property is accessed before the sdk is initialized.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) id<BDKCallRegistry> _Nonnull callRegistry;
  • The chat client instance.

    Throws: an NSInternalInconsistencyException is thrown when this property is accessed before the sdk is initialized.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) id<BDKChatClient> _Nonnull chatClient;
  • 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

    Objective-C

    @property (nonatomic, strong, nullable) id<BDKUserDetailsProvider> userDetailsProvider;

Initialization

  • Initialize the module with the appId and the configuration object provided as arguments.

    Once initialized, the module cannot be reinitialized anymore. Beware config object will be copied, so do not expect to change config options after the module has initialized.

    Throws an exception if this method is called more than once during the lifetime of the application. Throws an NSInvalidArgumentException exception if a blank appId argument is provided. Throws an NSInvalidArgumentException exception if a nil config object is provided.

    Declaration

    Objective-C

    - (void)initializeWithApplicationId:(nonnull NSString *)appId
                                 config:(nonnull BDKConfig *)config;

    Swift

    func initialize(withApplicationId appId: String, config: BDKConfig)

    Parameters

    appId

    The applicationId.

    config

    The config object.

User session

  • Opens a user session for the user with the alias provided as argument. Before starting any client you must call this method telling the sdk which user must be authenticated. Calling this method, while another session is already open, will close the old session calling the method [BandyerSDK closeSession] internally and open a new one.

    Throws an NSInvalidArgumentException exception if a blank userAlias is provided as argument.

    Declaration

    Objective-C

    - (void)openSessionWithUserId:(nonnull NSString *)userAlias;

    Swift

    func openSession(userId userAlias: String)

    Parameters

    userAlias

    The alias of the user you want to open the session for.

  • 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

    Objective-C

    - (void)closeSession;

    Swift

    func closeSession()

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 NO.

    Declaration

    Objective-C

    - (void)handleNotification:(nonnull PKPushPayload *)payload;

    Swift

    func handleNotification(_ payload: PKPushPayload)

    Parameters

    payload

    The payload of the VoIP push notification you received.

Singleton

  • Returns the global singleton instance.

    Declaration

    Objective-C

    + (nonnull instancetype)instance;

    Swift

    class func instance() -> Self

    Return Value

    the global singleton instance.