VIClient
Interface that provides API to connect and log in to the Voximplant Cloud, make and receive audio/video calls.
Methods
callConference:settings:
callConference:settings:(conference: NSString *
, settings: ): nullable VICall *
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:
Call settings with additional call parameters, such as the preferred video codec, custom data, extra headers etc.
Returns
type:
nullable VICall *
call:settings:
call:settings:(number: NSString *
, settings: ): nullable VICall *
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:
Call settings with additional call parameters, such as the preferred video codec, custom data, extra headers etc.
Returns
type:
nullable VICall *
clientVersion
clientVersion(): NSString *
Gets the SDK version.
Returns
type:
NSString *
connectTo:
connectTo:(node: ): BOOL
Connects to the Voximplant Cloud. Connectivity check is disabled.
Parameters
node:
Node the Voximplant account belongs to. Find more information about VIConnectionNode in the getting started guide
Returns
type:
BOOL
connectTo:connectivityCheck:gateways:
connectTo:connectivityCheck:gateways:(node: , connectivityCheck: BOOL
, gateways: nullable NSArray *
): BOOL
Connects to the Voximplant Cloud.
Parameters
node:
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
disconnect(): void
Disconnects from the Voximplant Cloud.
Returns
type:
void
handlePushNotification:
handlePushNotification:(notification: nullable NSDictionary *
): nullable NSUUID *
Handles an incoming push notification.
Parameters
notification:
nullable NSDictionary *
Incoming notification which comes from [PKPushRegistryDelegate pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:]
Returns
type:
nullable NSUUID *
initWithDelegateQueue:
initWithDelegateQueue:(queue: dispatch_queue_t
): instancetype
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:
initWithDelegateQueue:bundleId:(queue: dispatch_queue_t
, bundleId: nullable NSString *
): instancetype
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:
loginWithUser:oneTimeKey:success:failure:(user: NSString *
, oneTimeKey: NSString *
, success: nullable VILoginSuccess
, failure: nullable VILoginFailure
): void
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:
loginWithUser:password:success:failure:(user: NSString *
, password: NSString *
, success: nullable VILoginSuccess
, failure: nullable VILoginFailure
): void
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:
loginWithUser:token:success:failure:(user: NSString *
, token: NSString *
, success: nullable VILoginSuccess
, failure: nullable VILoginFailure
): void
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:
refreshTokenWithUser:token:result:(user: NSString *
, token: NSString *
, result: nullable VIRefreshTokenResult
): void
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:
registerIMPushNotificationsToken:completion:(imToken: NSData *
, completion: nullable VICompletionBlock
): void
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:
Use [VIClient registerVoIPPushNotificationsToken:completion:] and [VIClient registerIMPushNotificationsToken:completion:] instead.
registerPushNotificationsToken:imToken:(voipToken: nullable NSData *
, imToken: nullable NSData *
): BOOL
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
voipToken:
nullable NSData *
APNS token for VoIP push notifications which comes from [PKPushRegistryDelegate pushRegistry:didUpdatePushCredentials:forType:]
imToken:
nullable NSData *
APNS token for IM push notifications
Returns
type:
BOOL
registerVoIPPushNotificationsToken:completion:
registerVoIPPushNotificationsToken:completion:(voipToken: NSData *
, completion: nullable VICompletionBlock
): void
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
voipToken:
NSData *
APNS token for VoIP push notifications which comes from [PKPushRegistryDelegate pushRegistry:didUpdatePushCredentials:forType:]
completion:
nullable VICompletionBlock
Completion block to handle the result of the operation
Returns
type:
void
requestOneTimeKeyWithUser:result:
requestOneTimeKeyWithUser:result:(user: NSString *
, result: ): void
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
result:
Completion handler after the operation is completed
Returns
type:
void
setLogDelegate:
setLogDelegate:(logDelegate: id<VILogDelegate>
): void
Sets a log delegate to handle the Voximplant iOS SDK log messages.
Parameters
logDelegate:
id<VILogDelegate>
Log delegate instance
Returns
type:
void
setLogLevel:
setLogLevel:(logLevel: ): void
Sets a level for log messages. This method must be called before creating an SDK object instance.
Parameters
logLevel:
Log level
Returns
type:
void
unregisterIMPushNotificationsToken:completion:
unregisterIMPushNotificationsToken:completion:(imToken: NSData *
, completion: nullable VICompletionBlock
): void
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:
Use [VIClient unregisterVoIPPushNotificationsToken:completion:] and [VIClient unregisterIMPushNotificationsToken:completion:] instead.
unregisterPushNotificationsToken:imToken:(voipToken: nullable NSData *
, imToken: nullable NSData *
): BOOL
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
voipToken:
nullable NSData *
APNS token for VoIP push notifications which comes from [PKPushRegistryDelegate pushRegistry:didUpdatePushCredentials:forType:]
imToken:
nullable NSData *
APNS token for IM push notification
Returns
type:
BOOL
unregisterVoIPPushNotificationsToken:completion:
unregisterVoIPPushNotificationsToken:completion:(voipToken: NSData *
, completion: nullable VICompletionBlock
): void
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
voipToken:
NSData *
APNS token for VoIP push notifications which comes from [PKPushRegistryDelegate pushRegistry:didUpdatePushCredentials:forType:]
completion:
nullable VICompletionBlock
Completion block to handle the result of the operation
Returns
type:
void
webrtcVersion
webrtcVersion(): NSString *
Gets the underlying WebRTC version.
Returns
type:
NSString *
Props
callManagerDelegate
callManagerDelegate: Call manager delegate that handles incoming call events.
Returns
type:
calls
calls: Dictionary of actual calls with their ids.
Returns
type:
NSDictionary<NSString *, VICall *> *
enableForceRelayTraffic
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
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
messenger: Gets the instance of messaging subsystem.
Messenger instance.
Returns
type:
sessionDelegate
sessionDelegate: Session delegate that handles events for the connection with the Voximplant Cloud.
Returns
type: