iOS and macOS
The Voximplant iOS SDK enables real-time voice and video communication, peer-to-peer calling, and multi-party conferencing in native Apple applications. Starting with SDK v3, these capabilities extend to native macOS apps.
Use SDK v3 for all new integrations. It features a modular architecture, enhanced flexibility, a streamlined integration flow, and unified support for iOS and macOS.
API reference and migration
The SDK is distributed as binary XCFrameworks via Swift Package Manager (SPM). Review the SDK v3 Changelog for the latest release notes and framework size details.
SDK v3 requires the following minimum deployment targets:
- iOS: 12.0 or later
- macOS: 11.5 or later
Add Voximplant libraries to your project
The Voximplant iOS SDK features a modular architecture. You only need to import the specific packages required for your target application running on iOS or macOS.
SDK Products:
- VoximplantCore: handles cloud connectivity, session management, and user authentication.
- VoximplantCalls: provides audio and video calling functionality. Includes WebRTC dependencies automatically.
Integration via Xcode
- Open your project in Xcode.
- Select File → Add Package Dependencies…
- In the search field, enter the package repository URL:
https://github.com/voximplant/ios-sdk-releases.git - Set the Dependency Rule to a 3.x version requirement. Refer to the SDK Changelog for release notes and framework sizes.
- Select the required SDK products and assign them to your project’s build target.
Integration via SPM Package Manifest
If you are developing inside a Swift package, declare the dependency in your Package.swift file and link the necessary products to your target:
The Voximplant Swift Package does not strictly follow Semantic Versioning (SemVer), and backward compatibility between minor releases is not guaranteed. Always review the SDK Changelog before updating versions. Use exact or upToNextMinor dependency requirements to prevent unexpected breaking changes.
Permissions and capabilities
Depending on the features you implement, the Voximplant SDK requires standard platform privacy permissions and system capabilities on iOS and macOS.
All platforms
If your application uses the camera or microphone, add the following keys to your target’s Info.plist file:
Privacy - Camera Usage Description (NSCameraUsageDescription)Privacy - Microphone Usage Description (NSMicrophoneUsageDescription)
Provide clear, user-facing strings for each key. These explanations are displayed in system permission dialogs when your app requests access to the hardware.
Configure these keys for every iOS and macOS target that uses Voximplant calling features, even if you manage additional platform-specific capabilities separately in Xcode.
iOS
To maintain active calls, play background audio, and receive incoming call notifications on iOS, enable background modes in Xcode:
- Select your iOS app target in Xcode.
- Navigate to the
Signing & Capabilitiestab. - Click
+ Capabilityin the top-left corner and selectBackground Modes. - Enable the required modes for your feature set:
Audio, AirPlay, and Picture in PictureVoice over IPRemote notifications
macOS
macOS apps require additional entitlements beyond the shared Info.plist usage descriptions. Configure them in Xcode under Signing & Capabilities.
Hardened Runtime
Enable the Hardened Runtime capability to grant the SDK hardware access on macOS:
- Select your macOS app target in Xcode.
- Navigate to the
Signing & Capabilitiestab. - Click
+ Capabilityand add Hardened Runtime. - Under
Resource Access, enable:
Camera— required for video callsAudio Input— required for audio and video calls
App Sandbox
If your macOS app uses the App Sandbox, configure the following capabilities so the SDK can access media devices and connect to the Voximplant Cloud:
- Select your macOS app target in Xcode.
- Navigate to the
Signing & Capabilitiestab. - Click
+ Capabilityand addApp Sandboxif it is not already enabled. - Under
App Sandbox, enable:
Camera— required for video callsMicrophone— required for audio and video callsIncoming Connections (Network)— required to receive network trafficOutgoing Connections (Network)— required to connect to the Voximplant Cloud
Initialize the SDK
In Voximplant SDK v3, connection and user authentication are managed via the thread-safe, singleton VIClient instance. Obtain the shared instance and assign a session delegate to listen for global connection and session lifecycle events:
Configure the client whenever appropriate for your application’s architecture. Just ensure session listeners are assigned before initiating connections or authenticating users.
Connect and log in
To access Voximplant communication features, your application should first establish a connection to the Voximplant Cloud and authenticate a registered user.
The connection and authentication flow utilizes two primary asynchronous methods:
- connect(to:completion:) — Establishes a socket connection to the Voximplant Cloud based on your configuration parameters and returns the connection result via its completion handler.
- login(withPassword:user:completion:) — Validates user credentials against the platform and handles the authentication response. In addition to handling method completion callbacks, implement VIClientSessionDelegate to monitor global session state changes, such as unexpected disconnections.
When initializing and connecting the SDK to the Voximplant cloud, you need to specify the node to connect to. Your node is bound to your Voximplant account. To find which node your account belongs to, log in to your control panel and see the Credentials for working with API, SDK, SIP section on the main dashboard.
Connection and authentication flow
The code example below demonstrates how to configure the session delegate, connect to the Voximplant Cloud using your account’s node, and authenticate a user upon establishing a successful connection:
iOS SDK Demos
To accelerate your development, explore our reference applications showcasing best practices for Voximplant SDK v3:
Voximplant SDK v3 Demo Repository — Sample applications built with SwiftUI demonstrating:
- User Authentication: Logging in with account credentials.
- Audio Calling: Initiating, receiving, and managing audio call routing.
- CallKit Integration: Managing incoming calls using CallKit and PushKit (AudioCallKit sample).
Legacy SDK v2 demo applications remain available in our repository archives; however, all new integrations should reference the v3 sample applications.
iOS SDK v2 (Legacy)
Use SDK v2 only when maintaining an existing application. For all new projects, use SDK v3 to take advantage of its modular architecture, modern Swift features, and cross-platform support for iOS and macOS.
SDK v2 remains supported until December 31, 2027. Maintenance for SDK v2 is strictly limited to critical bug fixes, while all new features and ongoing platform enhancements are exclusive to SDK v3.
Dependency configuration (SDK v2)
Unlike SDK v3, SDK v2 is distributed as a single, monolithic package supporting iOS targets. You can integrate it using either CocoaPods or Swift Package Manager (SPM). Refer to the iOS SDK v2 Changelog for the latest release version.
Integration via CocoaPods
- Install CocoaPods (refer to the CocoaPods getting started guide).
- If your project lacks a Podfile, create one by running
pod initin your project directory. - Add the
VoxImplantSDKpod to your Podfile:
- Run
pod installin your terminal to install the dependency. - Open your project via the generated
.xcworkspacefile going forward.
We discontinued bitcode support since the 2.48.0 SDK version.
Integration via Swift Package Manager
In Xcode:
- Open your project in Xcode.
- Select File → Add Package Dependencies…
- Enter the package repository URL:
https://github.com/voximplant/ios-sdk-releases.git - Set the dependency rule to select a 2.x version. Refer to the iOS SDK v2 Changelog for release notes.
In a Swift Package Manifest:
If declaring the dependency within a Package.swift file, add the repository and link the product to your target:
Legacy connection and authentication flow
In SDK v2, connection and user authentication are managed using a VIClient instance and the VIClientSessionDelegate protocol.
The example below demonstrates instantiating the client, configuring the session delegate, handling connection lifecycle callbacks, and authenticating a user:
For detailed documentation on the legacy v2 API, refer to the iOS SDK v2 Reference.