Using iOS SDK

VoxImplant for iOS with demo project can be downloaded here

Adding SDK to your application

You need to add 2 libraries: libvoximplant_audio.a and libilbc.a to your project as well as all header files from VoxImplantSDKDemo/VoxImplantSDKiOS_audio/include/folder of the archive.

Initializing SDK

It's very simple. You need to create your interface that conforms to VoxImplantDelegate and invoke following sequence:

[[VoxImplant getInstance] setVoxDelegate:yourDelegate];

This delegate will later receive all events from SDK, for example ones related to the connection itself, login status, calls and audio status.

Logging in

It's the same as using WebSDK: you need to connect to cloud

[[VoxImplant getInstance] connect];

As a result message onConnectionSuccessful or onConnectionFailedWithError will be sent to your delegate.

After connection is established, use login function to authenticate. For example, when you need to login user myuser to applcation myapp in your VoxImplant account named myaccount with password mypass

[[VoxImplant getInstance] loginWithUsername:@"myuser@myapp.myaccount.voximplant.com" andPassword:@"mypass"];

As a result onLoginSuccessfulWithDisplayName: or onLoginFailedWithErrorCode: message will be sent to your delegate

Making calls

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

  1. VoxImplant * sdk = [VoxImplant getInstance];
  2. activeCallId = [sdk createCall:_toLabel.text withVideo:FALSE andCustomData:@"App custom data (mobile)"];
  3. [sdk attachAudioTo:activeCallId];
  4. [sdk startCall:activeCallId withHeaders:nil];

Please note that call is actually initiated only when you call

[sdk startCall: withHeaders:]

Receiving calls

When application receives incoming call, onIncomingCall:From:Named:withHeaders: message is sent to your delegate. If you need to answer call, you need to use following code:

  1. VoxImplant * sdk = [VoxImplant getInstance];
  2. [sdk attachAudioTo:activeCallId];
  3. [sdk answerCall:activeCallId withHeaders:nil];

Handling audio interruptions

Audio interruption happens when an incoming call to iPhone arrives. If user answers call, application will be suspended and most likely will be disconnected from server because of timeout.

When audio interruption begins and ends, onAudioInterruptionBegan and onAudioInterruptionEnded messages are sent to delegate. Please note that after interruption ends, speakerphone and mute are disabled, so you need to reflect that in your interface or re-enable them manually.

For more information, please read our reference documentation.