Rate this page:

VIClient

Interface that provides API to connect and log in to the Voximplant Cloud, make and receive audio/video calls.

Methods

callConference:settings:

Copy URL
- (

nullable VICall *

)callConference:(

NSString *

)conference
settings:(

VICallSettings *

)settings

Creates a call to a dedicated conference without proxy session. The call must be then started via [VICall start]. For details see the video conferencing guide.

Parameters

  • conference:

    NSString *

    Number to call. For SIP compatibility reasons it should be a non-empty string even if the number itself is not used by a Voximplant cloud scenario

  • settings:

    VICallSettings *

    Call settings with additional call parameters, such as the preferred video codec, custom data, extra headers etc.

Returns

call:settings:

Copy URL
- (

nullable VICall *

)call:(

NSString *

)number
settings:(

VICallSettings *

)settings

Creates a new call instance. The call must be then started via [VICall start].

Parameters

  • number:

    NSString *

    SIP URI, username or phone number to make call to. Actual routing is then performed by a VoxEngine scenario

  • settings:

    VICallSettings *

    Call settings with additional call parameters, such as the preferred video codec, custom data, extra headers etc.

Returns

clientVersion

Static
Copy URL
+ (

NSString *

)clientVersion

Gets the SDK version.

Returns

  • type:

    NSString *

connectTo:

Copy URL
- (

BOOL

)connectTo:(

VIConnectionNode

)node

Connects to the Voximplant Cloud. Connectivity check is disabled.

Parameters

Returns

  • type:

    BOOL

connectTo:connectivityCheck:gateways:

Copy URL
- (

BOOL

)connectTo:(

VIConnectionNode

)node
connectivityCheck:(

BOOL

)connectivityCheck
gateways:(

nullable NSArray *

)gateways

Connects to the Voximplant Cloud.

Parameters

  • Node the Voximplant account belongs to. Find more information about VIConnectionNode in the getting started guide

  • connectivityCheck:

    BOOL

    Checks whether UDP traffic flows correctly between the device and the Voximplant Cloud. This check reduces connection speed

  • gateways:

    nullable NSArray *

    List of the media gateway servers for connection

Returns

  • type:

    BOOL

disconnect

Copy URL
- (

void

)disconnect

Disconnects from the Voximplant Cloud.

Returns

  • type:

    void

handlePushNotification:

Copy URL
- (

nullable NSUUID *

)handlePushNotification:(

nullable NSDictionary *

)notification

Handles an incoming push notification.

Parameters

Returns

  • type:

    nullable NSUUID *

initWithDelegateQueue:

Copy URL
- (

instancetype

)initWithDelegateQueue:(

dispatch_queue_t

)queue

Initializes a client instance.

Parameters

  • queue:

    dispatch_queue_t

    All delegate methods are to be called on this queue. The queue should be serial, but not concurrent (the main queue is applicable)

Returns

  • type:

    instancetype

initWithDelegateQueue:bundleId:

Copy URL
- (

instancetype

)initWithDelegateQueue:(

dispatch_queue_t

)queue
bundleId:(

nullable NSString *

)bundleId

Initializes a client instance.

Use this API only if you are going to send push notifications across several iOS apps via a single Voximplant application.

Parameters

  • queue:

    dispatch_queue_t

    All delegate methods are to be called on this queue. The queue should be serial, but not concurrent (the main queue is applicable)

  • bundleId:

    nullable NSString *

    Application bundle id

Returns

  • type:

    instancetype

loginWithUser:oneTimeKey:success:failure:

Copy URL
- (

void

)loginWithUser:(

NSString *

)user
oneTimeKey:(

NSString *

)oneTimeKey
success:(

nullable VILoginSuccess

)success
failure:(

nullable VILoginFailure

)failure

Logs in a user with a one time key to the Voximplant Cloud.

Parameters

  • user:

    NSString *

    Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com

  • oneTimeKey:

    NSString *

    Hash that has been generated via the following formula:

    MD5(oneTimeKey+"|"+MD5(user+":voximplant.com:"+password))
    

    Please note that the user field is a username only, without app name, account name or anything else after "@".

    So if you pass myuser@myapp.myacc.voximplant.com as a username, you should only use myuser while computing this hash.

  • success:

    nullable VILoginSuccess

    Completion handler to be triggered if the operation is completed successfully

  • failure:

    nullable VILoginFailure

    Completion handler to be triggered if the operation is failed

Returns

  • type:

    void

loginWithUser:password:success:failure:

Copy URL
- (

void

)loginWithUser:(

NSString *

)user
password:(

NSString *

)password
success:(

nullable VILoginSuccess

)success
failure:(

nullable VILoginFailure

)failure

Logs in a user with a password to the Voximplant Cloud.

Parameters

  • user:

    NSString *

    Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com

  • password:

    NSString *

    User password

  • success:

    nullable VILoginSuccess

    Completion handler to be triggered if the operation is completed successfully

  • failure:

    nullable VILoginFailure

    Completion handler to be triggered if the operation is failed

Returns

  • type:

    void

loginWithUser:token:success:failure:

Copy URL
- (

void

)loginWithUser:(

NSString *

)user
token:(

NSString *

)token
success:(

nullable VILoginSuccess

)success
failure:(

nullable VILoginFailure

)failure

Logs in a user with an access token to the Voximplant Cloud.

Parameters

  • user:

    NSString *

    Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com

  • token:

    NSString *

    Access token obtained from authParams

  • success:

    nullable VILoginSuccess

    Completion handler to be triggered if the operation is completed successfully

  • failure:

    nullable VILoginFailure

    Completion handler to be triggered if the operation is failed

Returns

  • type:

    void

refreshTokenWithUser:token:result:

Copy URL
- (

void

)refreshTokenWithUser:(

NSString *

)user
token:(

NSString *

)token
result:(

nullable VIRefreshTokenResult

)result

Performs refresh of login tokens required for login via access token.

Parameters

  • user:

    NSString *

    Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com

  • token:

    NSString *

    Refresh token obtained from authParams

  • result:

    nullable VIRefreshTokenResult

    Completion handler after the operation is completed

Returns

  • type:

    void

registerIMPushNotificationsToken:completion:

Copy URL
- (

void

)registerIMPushNotificationsToken:(

NSData *

)imToken
completion:(

nullable VICompletionBlock

)completion

Registers Apple Push Notifications tokens.

After calling this API application can receive push notifications from the Voximplant Cloud. If the provided token is not nil, but the client is not logged in, the token is to be registered just after login.

Parameters

  • imToken:

    NSData *

    APNS token for IM push notifications

  • completion:

    nullable VICompletionBlock

    Completion block to handle the result of the operation

Returns

  • type:

    void

registerPushNotificationsToken:imToken:

Deprecated
Copy URL

Use [VIClient registerVoIPPushNotificationsToken:completion:] and [VIClient registerIMPushNotificationsToken:completion:] instead.

- (

BOOL

)registerPushNotificationsToken:(

nullable NSData *

)voipToken
imToken:(

nullable NSData *

)imToken

Registers Apple Push Notifications tokens.

After calling this API application can receive push notifications from the Voximplant Cloud. If the provided tokens are not nil, but the client is not logged in, the tokens are to be registered just after login, despite the API returns NO.

Parameters

Returns

  • type:

    BOOL

registerVoIPPushNotificationsToken:completion:

Copy URL
- (

void

)registerVoIPPushNotificationsToken:(

NSData *

)voipToken
completion:(

nullable VICompletionBlock

)completion

Registers Apple VoIP Push Notifications tokens.

After calling this API application can receive push notifications from the Voximplant Cloud. If the provided token is not nil, but the client is not logged in, the token is to be registered just after login.

Parameters

Returns

  • type:

    void

requestOneTimeKeyWithUser:result:

Copy URL
- (

void

)requestOneTimeKeyWithUser:(

NSString *

)user
result:(

VIOneTimeKeyResult

)result

Generates a one time login key to use in automated login process.

For additional information please see:

Parameters

  • user:

    NSString *

    Full user name, including app and account name, like someuser@someapp.youraccount.voximplant.com

  • Completion handler after the operation is completed

Returns

  • type:

    void

setLogDelegate:

Static
Copy URL
+ (

void

)setLogDelegate:(

id<VILogDelegate>

)logDelegate

Sets a log delegate to handle the Voximplant iOS SDK log messages.

Parameters

Returns

  • type:

    void

setLogLevel:

Static
Copy URL
+ (

void

)setLogLevel:(

VILogLevel

)logLevel

Sets a level for log messages. This method must be called before creating an SDK object instance.

Parameters

Returns

  • type:

    void

unregisterIMPushNotificationsToken:completion:

Copy URL
- (

void

)unregisterIMPushNotificationsToken:(

NSData *

)imToken
completion:(

nullable VICompletionBlock

)completion

Unregisters Apple Push Notifications tokens.

After calling this API application cannot receive push notifications from the Voximplant Cloud. If the provided token is not nil, but the client is not logged in, the token is to be unregistered just after login.

Parameters

  • imToken:

    NSData *

    APNS token for IM push notification

  • completion:

    nullable VICompletionBlock

    Completion block to handle the result of the operation

Returns

  • type:

    void

unregisterPushNotificationsToken:imToken:

Deprecated
Copy URL

Use [VIClient unregisterVoIPPushNotificationsToken:completion:] and [VIClient unregisterIMPushNotificationsToken:completion:] instead.

- (

BOOL

)unregisterPushNotificationsToken:(

nullable NSData *

)voipToken
imToken:(

nullable NSData *

)imToken

Unregisters Apple Push Notifications tokens.

After calling this API application cannot receive push notifications from the Voximplant Cloud. If the provided tokens are not nil, but the client is not logged in, the tokens are to be unregistered just after login, despite the API returns NO.

Parameters

Returns

  • type:

    BOOL

unregisterVoIPPushNotificationsToken:completion:

Copy URL
- (

void

)unregisterVoIPPushNotificationsToken:(

NSData *

)voipToken
completion:(

nullable VICompletionBlock

)completion

Unregisters Apple VoIP Push Notifications tokens.

After calling this API application cannot receive push notifications from the Voximplant Cloud. If the provided token is not nil, but the client is not logged in, the token is to be unregistered just after login.

Parameters

Returns

  • type:

    void

webrtcVersion

Static
Copy URL
+ (

NSString *

)webrtcVersion

Gets the underlying WebRTC version.

Returns

  • type:

    NSString *

Props

callManagerDelegate

Copy URL
@property (weak, nullable, nonatomic) 

id<VIClientCallManagerDelegate>

callManagerDelegate

Call manager delegate that handles incoming call events.

calls

Copy URL
@property (strong, readonly, nonatomic) 

NSDictionary<NSString *, VICall *> *

calls

Dictionary of actual calls with their ids.

Returns

  • type:

    NSDictionary<NSString *, VICall *> *

clientState

Copy URL
@property (readonly, nonatomic) 

VIClientState

clientState

Current client state.

Returns

enableForceRelayTraffic

Copy URL
@property (assign, nonatomic) 

BOOL

enableForceRelayTraffic

Whether to force traffic to go through TURN servers

Setting this property enables or disables traffic to go through TURN servers for all calls since next call.

Default is NO.

Returns

  • type:

    BOOL

enableVideoAdaptation

Copy URL
@property (assign, nonatomic) 

BOOL

enableVideoAdaptation

Whether a video adaptation for CPU usage and current bandwidth is enabled.

Setting this property enables or disables video adaptation for all calls since next call.

Default is YES.

Returns

  • type:

    BOOL

messenger

Copy URL
@property (strong, readonly, nonatomic) 

VIMessenger *

messenger

Gets the instance of messaging subsystem.

Messenger instance.

Returns

sessionDelegate

Copy URL
@property (weak, nullable, nonatomic) 

id<VIClientSessionDelegate>

sessionDelegate

Session delegate that handles events for the connection with the Voximplant Cloud.

Returns