Rate this page:

iOS

This article will help you to start building your iOS application with Voximplant.

The simplest way to add Voximplant libraries to your Xcode project is to use Cocoapods. Optionally, you can use Swift Package Manager.

Start with Cocoapods

Copy URL
  1. Install CocoaPods (See CocoaPods getting started guide)
  2. If you do not have a podfile, create it by running pod init in the project directory
  3. Add VoxImplantSDK dependency in the Podfile. The syntax differs if you want to use bitcode or not.
What is bitcode?

Bitcode is an Apple's technology that enables you to recompile your app for a specific device and architecture while installing it to the device. It reduces the application's size, but the Xcode project folder takes more disk space.

If you want to use bitcode, download Voximplant iOS SDK and the corresponding WebRTC archives (see the links at the bottom of this page), extract them to the any place on your disk and point on them in your Podfile like it is shown below:

platform: ios, '9.0'
use_frameworks!

target 'MyApp' do
    // other dependencies and configurations
    pod 'VoxImplantSDK', :path => 'Path/To/VoxImplant_bitcode/'
    pod 'VoxImplantWebRTC', :path => 'Path/To/VoxImplantWebRTC_bitcode/'
end 

If you do not want to use bitcode, go to your Xcode main project file → the Build Settings tab, find the Enable Bitcode parameter and set its value to No. After that open your Podfile, add the Voximplant SDK and disable bitcode like it is shown below:

platform: ios, '9.0'
use_frameworks!

target 'MyApp' do
    // other dependencies and configurations
    pod 'VoxImplantSDK'
    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['ENABLE_BITCODE'] = 'NO'
            end
        end
    end
end
  1. Run the pod install command in the project directory to install the SDK
  2. From now on, open your project via the newly created .xcworkspace file

Start with Swift Package Manager

Copy URL
Info

Skip this section if you are using CocoaPods.

Alternatively, you can use Swift Package Manager to add the dependencies to your project.

  1. Open your project in Xcode
  2. Go File → Swift Packages → Add Package Dependency
  3. Add the iOS SDK github repository contents. The repository differs depending on if you want to use bitcode or not.
What is bitcode?

Bitcode is an Apple's technology that enables you to recompile your app for a specific device and architecture while installing it to the device. It reduces the application's size, but the Xcode project folder takes more disk space.

3.1. If you want to use bitcode, use this repository

3.2. If you do not want to use bitcode, use this repository

  1. Select the SDK version
  2. Declare the package in the Package.swift file's dependencies section:
dependencies: [
    .package(url: "https://github.com/voximplant/ios-sdk-releases.git", .upToNextMinor(from: "2.42.1"))
]
Versioning

The Voximplant Swift Package does not fully meet the semantic versioning, so backwards compability is not guaranteed. Please check the changelog before a version update.

Initialize the SDK

Copy URL
  1. If you need to use camera and microphone in your app, open the Info.plist file in your project and add the following keys:
  • Privacy - Camera Usage Description

  • Privacy - Microphone Usage Description

Provide values to the added keys. The value is what a device shows when prompts for camera or microphone access.

  1. Declare four Background modes. Go to your project's main file, Singing & Capabilities tab, click the "+" button on the top and choose "Background modes". To enable calls and push notification functionality, choose the following modes as you see on the screenshot:
Background modes

Now you are ready to create a Voximplant client instance. To do so, import VoxImplantSDK to your swift class and create an instance of VIClient as shown below:

Create a client instance

Create a client instance

Connect to the Voximplant cloud and login

Copy URL

To create a client instance and to connect, import VoxImplantSDK to your swift class. Also, your class should support the VIClientSessionDelegate protocol.

On the class initialization, create a Voximplant client instance and declare your class as a session delegate for the client instance (see the code example below). Then call the connect method to connect to the cloud.

In the clientSessionDidConnect function, call the login(password) method to log in to the platform with password or the login(oneTimeKey) to log in with one time key.

Refer to this code example to understand the login process:

Connect and login

Connect and login

Start implementing functionality

Copy URL

Now you have your application and SDK set up and successfully connected to the Voximplant cloud. To start implementing desired functionality, such as calls, conferences, messages, and more, go to the Guides section of our documentation and pick the features you need.

Bitcode version history

Copy URL

Bitcode is an Apple's technology that enables you to recompile your app for a specific device and architecture while installing it to the device. It reduces the application's size, but the Xcode project folder takes more disk space.

If you want to use bitcode for your project, choose the version you want to use and the corresponding WebRTC and use it as it is explained in the Start with Cocoapods section. For new applications, we recommend the latest version.

iOS SDK demos

Copy URL

Implement the desired functionality by following step-by-step Guides or download and test our latest iOS SDK here:

  • Audio call: Demonstrates the basic audio call functionality of the Voximplant iOS SDK.

  • Audio call with CallKit: Demonstrates the CallKit integration with the basic audio call functionality of the Voximplant iOS SDK.

  • Video call: Demonstrates the basic video call functionality of the Voximplant iOS SDK.

  • Video call with CallKit: Demonstrates how to integrate CallKit with the basic video call functionality of the Voximplant iOS SDK.

  • Videoconf solution: Demonstrates how videoconf.voximplant.com works. Using it, you can create conferences, join existing conferences, use reactions, create chats, and do many more useful things.

  • Messaging: Demonstrates how to create your web and mobile messaging client based on the Voximplant SDKs.