logo
On this page

Quick start


Prepare the environment

Before you attempt to integrate the SDK, make sure that the development environment meets the following requirements:

  • Xcode 15.0 or higher version.
  • iOS 12.0 or higher version and iOS devices that support audio and video.
  • The iOS device is connected to the Internet.

Integrate the SDK

  1. Add ZegoUIKitPrebuiltVideoConference as dependencies

    1. Open Terminal, navigate to your project's root directory, and run the following to create a podfile:
    Untitled
    pod init
    
    1
    Copied!
    1. Edit the Podfile file to add the basic dependency:
    Untitled
    pod 'ZegoUIKitPrebuiltVideoConference'
    
    1
    Copied!
    1. In Terminal, run the following to download all required dependencies and SDK with Cocoapods:
    Untitled
    pod install
    
    1
    Copied!
  2. Import ZegoUIKit & ZegoUIKitPrebuiltVideoConference to your project

    YourViewController.swift
    import ZegoUIKit
    import ZegoUIKitPrebuiltVideoConference
    // YourViewController.swift
    class ViewController: UIViewController {
        //Other code...
    }
    
    1
    Copied!
  3. Using the ZegoUIKitPrebuiltVideoConferenceVC in your project

    1. Go to ZEGOCLOUD Admin Console, get the appID and appSign of your project.
    2. Specify the userID and userName for connecting the Video Conference Kit service.
    3. Create a conferenceID that represents the conference you want to start.
    Note
    • userID and conferenceID can only contain numbers, letters, and underlines (_).
    • Using the same conferenceID will enter the same video conference.
    Untitled
    class ViewController: UIViewController {
        var userID: String = <#UserID#>
        var userName: String = <#UserName#>
        var conferenceID: String = <#ConferenceID#>
    
        @IBAction func enterMeeting(_ sender: Any) {
    
            let config: ZegoUIKitPrebuiltVideoConferenceConfig = ZegoUIKitPrebuiltVideoConferenceConfig()
            let videoConferenceVC: ZegoUIKitPrebuiltVideoConferenceVC = ZegoUIKitPrebuiltVideoConferenceVC.init(appID, appSign: appSign, userID: userID, userName: userName, conferenceID: conferenceID, config: config)
    
            videoConferenceVC.modalPresentationStyle = .fullScreen
            self.present(videoConferenceVC, animated: true, completion: nil)
        }
    }
    
    1
    Copied!

Then, you can start a video conference by presenting the VC.

Configure your project

Open the Info.plist, add the following code inside the dict part:

Untitled
<key>NSCameraUsageDescription</key>
<string>Access permission to camera is required.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Access permission to microphone is required.</string>
1
Copied!

Run & Test

Now you have finished all the steps!

You can simply click the Run in XCode to run and test your App on your device.

Custom Prebuilt UI

Resources

Sample Code

Click here to get the complete sample code.

Previous

Overview

Next

Overview