BCXCallClient

Objective-C

@protocol BCXCallClient <NSObject>

Swift

protocol BCXCallClient : NSObjectProtocol

It’s the main item required to connect to the Bandyer platform. Once initialized, the object will connect and keep the connection with Bandyer platform, communicating and exchanging events with the servers. After a connection is established, the server will authenticate the client. Once the authentication is successful, it will be possible to make and receive calls to and from other users.

This item has the following capabilities:

  • It places calls with other users within the same company. Bandyer platform will contact the designated users, notifying them if they are offline. If the call can be placed, the call process will be handled by the BCXCall object.
  • it receives incoming calls from other users within the same company.
  • It allows to join a call through an URL received from outside the app.
  • It allows to join a call through a remote notification.

User

  • The user currently authenticated with bandyer platform.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) id<BCXUser> user;

Client state

  • A property holding the current state of the client.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BCXCallClientState state;

    Swift

    var state: BCXCallClientState { get }
  • Returns a boolean flag indicating whether the client is stopped or not

    Declaration

    Objective-C

    - (BOOL)isStopped;

    Swift

    func isStopped() -> Bool

    Return Value

    a boolean flag indicating whether the client is stopped or not

  • Returns a boolean flag indicating whether the client is starting or not

    Declaration

    Objective-C

    - (BOOL)isStarting;

    Swift

    func isStarting() -> Bool

    Return Value

    a boolean flag indicating whether the client is starting or not

  • Returns a boolean flag indicating whether the client is running or not

    Declaration

    Objective-C

    - (BOOL)isRunning;

    Swift

    func isRunning() -> Bool

    Return Value

    a boolean flag indicating whether the client is running or not

  • Returns a boolean flag indicating whether the client is paused or not

    Declaration

    Objective-C

    - (BOOL)isPaused;

    Swift

    func isPaused() -> Bool

    Return Value

    a boolean flag indicating whether the client is paused or not

  • Returns a boolean flag indicating whether the client is resuming or not

    Declaration

    Objective-C

    - (BOOL)isResuming;

    Swift

    func isResuming() -> Bool

    Return Value

    a boolean flag indicating whether the client is resuming or not

  • Returns a boolean flag indicating whether the client is reconnecting or not

    Declaration

    Objective-C

    - (BOOL)isReconnecting;

    Swift

    func isReconnecting() -> Bool

    Return Value

    a boolean flag indicating whether the client is reconnecting or not

Observer

  • Adds an observer that will be notified synchronously on a private background queue. The observer object will be held weakly.

    Declaration

    Objective-C

    - (void)addObserver:(nonnull id<BCXCallClientObserver>)observer;

    Parameters

    observer

    The observer to be added.

  • Adds an observer specifying on which dispatch queue it must be notified. If a nil queue is provided the observer will be notified synchronously on a private background queue. Otherwise the observer will be notified asynchronously on the queue provided. The observer will be held weakly.

    Declaration

    Objective-C

    - (void)addObserver:(nonnull id<BCXCallClientObserver>)observer
                  queue:(nullable dispatch_queue_t)queue;

    Parameters

    observer

    The observer to add.

    queue

    The dispatch queue onto which the observer will be notified.

  • Removes a client observer.

    Declaration

    Objective-C

    - (void)removeObserver:(nonnull id<BCXCallClientObserver>)observer;

    Parameters

    observer

    The observer to be removed.

Starting, stopping the client

  • Start the client, connecting it to bandyer’s platform.

    Remark: Throws an NSInvalidArgumentException when passing a blank user id as parameter

    Declaration

    Objective-C

    - (void)start:(nonnull NSString *)userId;

    Swift

    func start(_ userId: String)

    Parameters

    userId

    The user alias of the user

  • Resumes the client, reconnecting it to bandyer’s platform, after the client has been paused first. You should call this method after the client has been paused, for example you might resume the client when the app returns in foreground.

    Declaration

    Objective-C

    - (void)resume;

    Swift

    func resume()
  • Pause the client, disconnecting it from bandyer’s platform. You should call this method when you want to stop the client from detecting incoming calls and making outgoing calls, for example you might pause the client when the app goes in background.

    Declaration

    Objective-C

    - (void)pause;

    Swift

    func pause()
  • Stop the client, disconnecting it from bandyer’s platform. You should stop it when app is going to be terminated. Once the client has been stopped, you must start it once again calling [BCXCallClient start:] method if you want to reuse it.

    Declaration

    Objective-C

    - (void)stop;

    Swift

    func stop()

Actions

  • Performs the action provided as argument. Success or failure is reported through the action itself.

    Declaration

    Objective-C

    - (void)performAction:(nonnull id<BCXAction>)action;

    Parameters

    action

    The action to be performed.

Verified User

  • Declaration

    Objective-C

    - (void)verifiedUser:(BOOL)verified
                 forCall:(nonnull id<BCXCall>)call
              completion:(void (^_Nullable)(NSError *_Nullable))completion;

    Parameters

    verified

    A boolean flag indicating if the user is actually verified.

    call

    The call on which set verified the current logged user.