Vonage Video API iOS SDK
The Vonage Video API iOS SDK lets you use Vonage Video API-powered video sessions in apps you build for iPad, iPhone, and iPod touch devices.
- SDK overview
- API reference
- Tutorials
- Samples
- Release Notes
All applications that use the Vonage Video API are composed of two parts:
- The client-side, which uses the OpenTok client SDKs and runs in a user's browser or mobile app
- The server-side, which uses the OpenTok server SDKs and runs on your server to pass authentication information to the client.
The client SDK for building iOS apps is the OpenTok iOS SDK, which provides most of the core functionality for your app, including:
- Connecting to an OpenTok session
- Publishing streams to a session
- Subscribing to streams in a session
Client SDKs are also available for web, Android, iOS, Windows, macOS, Linux, and React Native. All OpenTok client SDKs can interact with one another.
You can learn more about the basics of OpenTok clients, servers, sessions, and more on the Video API Basics page.
Important Notes
- Version 2.35.1+ of the SDK only supports iOS 17 or higher.
- Version 2.35.1+ supports Swift Package Manager. CocoaPods distribution is deprecated and will be removed in a future release.
- Version 2.33.0+ of the SDK supports Apple silicon Macs running macOS 14 or later. See macOS Support section below for platform-specific considerations and limitations.
- Screen sharing on macOS is limited to the app's own window — Full desktop capture is not supported. See this known issue for details.
- Changes to iOS 14 networking affecting relayed sessions — see the list of known issues in the release notes.
- Issues using Simulator to preview your app on a Mac with an M1 chip — see the list of known issues in the release notes.
Interoperability
Apps written with the OpenTok iOS SDK 2.35.1 can interoperate with OpenTok apps written with version 2.33+ of the OpenTok client SDKs:
- OpenTok.js
- OpenTok Android SDK
- OpenTok iOS SDK
- OpenTok Windows SDK
- OpenTok macOS SDK
- OpenTok Linux SDK
- OpenTok React Native SDK
Installation
The Vonage Video iOS SDK supports Swift Package Manager (SPM) as the recommended distribution method, available since v2.35.1. CocoaPods distribution via the OTXCFramework pod is also maintained for backward compatibility while CocoaPods support remains available, but it is being deprecated and will eventually be removed.
Recommendation: New projects should use Swift Package Manager. If you are currently using CocoaPods, see the Migrating from CocoaPods section below.
Swift Package Manager (Recommended)
Swift Package Manager is integrated directly into Xcode and requires no additional tooling.
In Xcode:
- Open your project in Xcode.
- Go to File > Add Package Dependencies…
- Enter the following repository URL in the search bar: https://github.com/opentok/opentok-ios-sdk.git
- Select the version rule (e.g. Up to Next Major) and click Add Package.
- Select the OpenTokClientSDKVideo library and click Add to Target.
SPM dependencies are resolved and downloaded automatically when building or opening the project in Xcode. You can view them under the Package Dependencies section in the Project Navigator.
CocoaPods (Deprecated)
⚠️ Deprecation notice: CocoaPods distribution is being deprecated. The OTXCFramework pod will continue to be maintained while CocoaPods support is available, but we strongly recommend migrating to Swift Package Manager.
Add the following to your Podfile:
target 'YourApp' do
pod 'OTXCFramework'
end
Then run:
Open the generated .xcworkspace file (not .xcodeproj) to build your project.
Migrating from CocoaPods
If your project currently uses the OTXCFramework CocoaPods pod, follow these steps to migrate to Swift Package Manager:
- Remove CocoaPods from your project:
This removes all CocoaPods build phases and settings from your .xcodeproj.
-
Delete CocoaPods files: Remove
Podfile,Podfile.lock, and thePods/directory from your project folder. Also delete the CocoaPods-generated.xcworkspaceif you no longer need it. -
Add the SDK via SPM: Follow the Swift Package Manager instructions above to add
https://github.com/opentok/opentok-ios-sdk.gitas a package dependency. -
Update your imports: If you were importing
OpenTok, the module name remains the same — no import changes are required. -
Build and verify: Open your
.xcodeprojdirectly in Xcode (no.xcworkspaceneeded for SPM-only projects) and build to confirm everything resolves correctly.
System Requirements
The current version of the OpenTok iOS SDK (2.35.1+) is supported in iOS 17 or higher.
The OpenTok iOS SDK is supported on Wi-Fi, 4G/LTE, and 5G connections.
The OpenTok iOS SDK requires Xcode 7 or higher.
For reliable video streaming, ensure your device meets these recommended specs:
- CPU: Apple A12 Bionic or newer.
- RAM: At least 4 GB RAM for group calls and multitasking.
- Display: 5.4"+ for iPhone, 10.2"+ for iPad.
- Battery capacity: 3000+ mAh for iPhone, 7000+ mAh for iPad.
- Network: Reliable internet connectivity; works over Wi‑Fi or cellular.
These recommendations ensure stable playback, lower CPU usage, and smooth performance when streaming video.
Device examples: iPhone XS or newer (2018+), iPad Pro (any generation), iPad Air 3 or newer, iPad mini 5 or newer.
Learning to Build
The best way to learn how to use the OpenTok iOS SDK is to follow the OpenTok Basic Video Chat tutorial:
Once you understand the basics of building with the OpenTok iOS SDK, you can get more detailed information and learn how to customize your application with the OpenTok developer guides. To investigate specific API classes and methods, see the OpenTok iOS SDK API reference.
Using the SDK
The OpenTok.framework directory contains the OpenTok iOS SDK.
The OpenTok iOS SDK requires the following frameworks and libraries:
- AudioToolbox.framework
- AVFoundation.framework
- CoreGraphics.framework
- CoreMedia.framework
- CoreTelephony.framework
- CoreVideo.framework
- Foundation.framework
- GLKit.framework
- libc++.dylib (libc++.tbd in Xcode 7+)
- libsqlite3.dylib (libsqlite3++.tbd in Xcode 7+)
- Metal.framework
- MetalKit.framework
- MetalPerformanceShaders.framework
- OpenGLES.framework
- QuartzCore.framework
- SystemConfiguration.framework
- UIKit.framework
- VideoToolbox.framework
The OpenTok iOS SDK links to the libc++ standard library. If another library that links to the libc++ standard library was compiled in a version of Xcode older than 6.0.0, it may result in segfaults at run time when using it with the OpenTok iOS SDK. Known incompatible libraries include, but are not limited to, Firebase (versions earlier than 2.1.2 -- see https://code.google.com/p/webrtc/issues/detail?id=3992) and Google Maps (versions earlier than 1.9.0). To fix this issue, download a version of the other library that was compiled using XCode 6.0.0 or later.
If you are using a version of Xcode prior to 7.2.0, do not use the -all_load linker flag. Instead, use the -force_load linker flag to load specific libraries that require it.
In order to access the camera and microphone, iOS 10 requires you to set values for the NSCameraUsageDescription and NSMicrophoneUsageDescription keys in the Info.plist file. These define strings that appear in the app installer to inform the user why your app uses the camera and microphone. For more information see the Apple documentation on Cocoa keys.
See this content for information on using the SDK in apps running in the background mode.
macOS Support
The OpenTok iOS SDK 2.33.0+ is supported on Apple silicon Macs (M1, M2, M3, and later) running macOS 14 or later. On macOS, the SDK offers most of the same features available on iOS devices, though there are a few platform-specific differences and limitations to keep in mind.
Camera Behavior on macOS
macOS devices typically have a single built-in camera (the FaceTime camera), which is always mapped as the front camera (AVCaptureDevicePositionFront). External cameras connected to the Mac are also treated as front cameras.
Important considerations:
- Unlike iOS devices, Macs do not have a concept of "back camera"
- The
cameraPositionproperty will always resolve to front camera on macOS - To switch between multiple cameras (e.g., built-in vs. external) on macOS, you can implement a custom video capturer. For more information, see this documentation.
Rotation Handling
Warning: macOS devices do not support automatic orientation rotation like iOS mobile devices.
- Video is always published in landscape orientation
- Device rotation events do not occur on macOS
- Applications must handle orientation manually if specific layout adjustments are needed
Torch (Flashlight) Limitation
Warning: The camera torch (flashlight) feature is not available on macOS.
- Setting the
cameraTorchproperty toYESwill have no effect on macOS - Mac cameras (built-in or external) do not support torch/flashlight functionality
- This feature is specific to iOS mobile devices
Code Samples
For sample code, visit our vonage-video-ios-sdk-samples repo on GitHub.
Documentation & More Information
Reference documentation is included in the doc subdirectory of the SDK and in the local SDK reference.
For a list of new features and known issues, see the release notes.