VIClient
Interface that provides API to connect and log in to the Voximplant Cloud, make and receive audio/video calls.
Methods
callConference:settings:
- (nullable VICall *
)callConference:(NSString *
)conference 
              settings:()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:- Call settings with additional call parameters, such as the preferred video codec, custom data, extra headers etc. 
Returns
- type:- nullable VICall * 
call:settings:
- (nullable VICall *
)call:(NSString *
)number 
    settings:()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:- Call settings with additional call parameters, such as the preferred video codec, custom data, extra headers etc. 
Returns
- type:- nullable VICall * 
clientVersion
+ (NSString *
)clientVersionGets the SDK version.
Returns
- type:- NSString * 
connectTo:
- (BOOL
)connectTo:()node 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:
- (BOOL
)connectTo:()node 
    connectivityCheck:(BOOL
)connectivityCheck 
             gateways:(nullable NSArray *
)gateways 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
- (void
)disconnectDisconnects from the Voximplant Cloud.
Returns
- type:- void 
handlePushNotification:
- (nullable NSUUID *
)handlePushNotification:(nullable NSDictionary *
)notification Handles an incoming push notification.
Parameters
- notification:- nullable NSDictionary * - Incoming notification which comes from [PKPushRegistryDelegate pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:] 
Returns
- type:- nullable NSUUID * 
initWithDelegateQueue:
- (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:
- (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:
- (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:
- (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:
- (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:
- (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:
- (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:
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
- 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:
- (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
- 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:
- (void
)requestOneTimeKeyWithUser:(NSString *
)user 
                           result:()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 
- result:- Completion handler after the operation is completed 
Returns
- type:- void 
setLogDelegate:
+ (void
)setLogDelegate:(id<VILogDelegate>
)logDelegate Sets a log delegate to handle the Voximplant iOS SDK log messages.
Parameters
- logDelegate:- id<VILogDelegate> - Log delegate instance 
Returns
- type:- void 
setLogLevel:
+ (void
)setLogLevel:()logLevel 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:
- (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:
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
- 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:
- (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
- 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
+ (NSString *
)webrtcVersionGets the underlying WebRTC version.
Returns
- type:- NSString * 
Props
callManagerDelegate
@property (weak, nullable, nonatomic)  callManagerDelegateCall manager delegate that handles incoming call events.
Returns
- type:
calls
@property (strong, readonly, nonatomic) NSDictionary<NSString *, VICall *> *
callsDictionary of actual calls with their ids.
Returns
- type:- NSDictionary<NSString *, VICall *> * 
clientState
@property (readonly, nonatomic)  clientStateCurrent client state.
Returns
- type:
enableForceRelayTraffic
@property (assign, nonatomic) BOOL
 enableForceRelayTrafficWhether 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
@property (assign, nonatomic) BOOL
 enableVideoAdaptationWhether 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
@property (strong, readonly, nonatomic) messengerGets the instance of messaging subsystem.
Messenger instance.
Returns
- type:
sessionDelegate
@property (weak, nullable, nonatomic)  sessionDelegateSession delegate that handles events for the connection with the Voximplant Cloud.
Returns
- type: