Using iOS SDK

This guide provides you to make the simplest application to make audio calls. You can start by downloading our demo application

Demo application with CallKit integration

iOS SDK has three dependencies, you can check them directly in the cocoapods site.

You can make and receive calls using your device’s data connection to/from any other endpoint that works with Voximplant: other mobile app built using Voximplant Mobile SDK, a web application built using the Web SDK, SIP phones and phone numbers all over the world.


Adding SDK to your application using Cocoapods

  • Install the CocoaPods (see getting starting guide)
  • Follow the instructions to create or modify Podfile
  • Add VoxImplantSDK dependency to your traget in Podfile
    target 'MyApp' do
      //other dependencies and configurations
      pod 'VoxImplantSDK'
  • Run "pod install" command in terminal from your project directory
    pod install
  • Open the *.xcworkspace that was created. This should be the file you use everyday to create your app

You can see the example of Podfile in demo's repository.


Initializing SDK

Include the NSMicrophoneUsageDescription and NSCameraUsageDescription keys in your app's Info.plist file and provide a purpose strings for this keys. If your app attempts to access any of the device’s microphones or cameras without a corresponding purpose strings, your app exits. 

You also have to declare four Background Modes:

  • Audio and AirPlay
  • Background fetch
  • Remote notifications
  • Voice over IP

Enabling the Background Modes option adds the UIBackgroundModes key to your app’s Info.plist file. Selecting checkboxes in Xcode adds the corresponding background mode values to that key. 


Then create VIClient instance and initialize it as specified in documentation:


let client = VIClient(delegateQueue: DispatchQueue.main)


VIClient *client = [[VIClient alloc] 


Logging in

Firstly you need to connect to the Voximplant cloud. As a result the clientSessionDidConnect: or client:sessionDidFailConnectWithError: event will be sent to VIClientSessionDelegate. After connection is established, use the loginWithUser:password:success:failure: function to authenticate. For example, when you need to login user myuser to applcation myapp in your Voximplant account named myaccount with password mypass


class SomeClass : NSObject, VIClientSessionDelegate, VIClientCallManagerDelegate {
    var client : VIClient?
    var call : VICall?
    override init() {
        self.client = VIClient(delegateQueue: DispatchQueue.main)
        self.client?.sessionDelegate = self
    func clientSessionDidConnect(_ client: VIClient!) {
        NSLog("Connection established")
        // For other login methods please see the article:
        self.client?.login(withUser: "",
                           password: "mypass",
                            success: {
                              (displayName, authParams) in
                               NSLog("Login success")
                            failure: {
                              error in
                              NSLog("Login failed")


@interface SomeClass () <VIClientSessionDelegate, VIClientCallManagerDelegate>
@property (strong, nonatomic) VIClient *client;
@property (strong, nonatomic) VICall *call;
@implementation SomeClass
- (instancetype)init {
    self = [super init];
    if (self) {
        self.client = [[VIClient alloc] 
        self.client.sessionDelegate = self;
        [self.client connect];
    return self;
- (void)clientSessionDidConnect:(VIClient *)client {
    NSLog(@"Connection established");
    // For other login methods please see the article:
    [client loginWithUser:@""
                  success:^(NSString *displayName, NSDictionary *authParams) {
                      NSLog(@"Login succeeded");
                  failure:^(NSError *error) {
                      NSLog(@"Login failed with error %@", error.localizedDescription);


Making calls

To make an outbound audio call you need to run following code sequence:


func makeTestCall() {
    let call = self.client?.call(toUser: "to",
                                 withSendVideo: false,
                                 receiveVideo: false,
                                 customData: nil)
    call!.start(withHeaders: nil)


- (void)makeTestCall {
    VICall *call = [_client callToUser:@"to"
    [call startWithHeaders:nil];

Please note that call is actually initiated only when you call the appropriate method (see the last line in the examples).


Receiving calls

You have to set delegate VIClientCallManagerDelegate to handle an incoming call. When application receives incoming call, the client:didReceiveIncomingCall:withIncomingVideo:headers: event is sent to your delegate. If you need to answer the call, you have to use following code:


func client(_ client: VIClient!, 
            didReceiveIncomingCall call: VICall!, 
            withIncomingVideo video: Bool, 
            headers: [AnyHashable : Any]!) {
    call.answer(withSendVideo: video, 
                receiveVideo: video, 
                customData: nil, 
                headers: nil)


- (void)        client:(VIClient *)client
didReceiveIncomingCall:(VICall *)call
               headers:(NSDictionary *)headers {
    [call answerWithSendVideo:video 


Terminating calls

Using the hangupWithHeaders: method allows to terminate the call properly. Both participants will receive the call:didDisconnectWithHeaders:answeredElsewhere: event after hangup's call will be executed.


func hangUp() { nil)


- (void)hangUp {
    [ hangupWithHeaders:nil];


For more information, please read our reference documentation.

Get your free developer account or talk with our sales team to learn more about Voximplant solutions
Contact sales

Please complete this field.

Please complete this field.

Please complete this field.

Choose the solution

Please complete this field.

Please complete this field.