Swift

Adding the Vonage Video Library

Swift Package Manager

You can add the Vonage Client SDK Video iOS by adding the https://github.com/opentok/vonage-client-sdk-video.git repository as a Swift Package Dependency.

To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL.

Cocoapods

Tap to expand installation steps

Follow the steps below to use CocoaPods to add the Vonage Video library and its dependencies to your app.

  1. In the Terminal, navigate to the root directory of your project and enter:

This creates a Podfile at the root of your project directory.

  1. Edit the Podfile and add the following line after the comment that says # Pods for [YourProjectName] (The podfile will not be visible in your XCode project, so you will need to open it from the project folder directly):
  1. Save changes to the Podfile.

  2. Open your project's root directory in the Terminal and type:

  1. Close your project in Xcode. Then reopen your project by double-clicking the new .xcworkspace file in the Finder (in the root directory of your project).

Add camera and microphone access using Info.plist Values

  1. In the left navigator panel, click your project file to open the project editor. Make sure your app target (not tests) is selected.

  2. Switch to the Build Settings tab.

  3. Search for Info.plist Values.

  4. Locate the following keys and set their values:

    • Privacy - Camera Usage Description
      $(PRODUCT_NAME) uses the camera.

    • Privacy - Microphone Usage Description
      $(PRODUCT_NAME) uses the microphone.

These values will be included in the app's generated Info.plist at build time and are required when requesting camera and microphone access.

Import the Vonage Video library

In Xcode, create a new file VonageVideoManager.swift and at the beginning of the file, add a line to import the Vonage video library:

Basic video chat

Learn the basic concepts of the Vonage Video API platform, including how users can communicate through video, voice, and messaging. Explore a basic Vonage Video API flow.

Steps
1
Introduction
2
Getting Started
3
Creating a New Project
4
Adding the Vonage Video Library
5
Setting Up Authentication
6
Connecting to the Session
7
Publishing a Stream to the Session
8
Subscribing to Other Clients' Streams
9
Running the App
10
Conclusion