Video Call
  • iOS : Objective-C
  • Android
  • Web
  • Flutter
  • React Native
  • Electron
  • Unity3D
  • Cocos Creator
  • Windows
  • macOS
  • Linux
  • Overview
  • Develop your app
    • Integrate the SDK
    • Implement a basic video call
    • Enhance basic feature
      • Use Tokens for authentication
      • Config your video based on scenes
      • Check the room connection status
      • Set up common video config
      • Set up common audio config
  • Best practices
  • Upgrade using advanced features
  • Upgrade using Add-on
  • Resources & Reference
    • SDK
    • Sample codes
    • API reference
    • Debugging
    • FAQs
    • Key concepts
Sample code

Sample source code running guide

This article describes how to quickly run the sample source code and experience basic audio and video calling services.

1 Prepare the environment

Before you run the sample source code, make sure that the development environment meets the following requirements:

  • Xcode 13.0 or above.
  • iOS devices or simulators with iOS 9.0 or above that support audio and video (real devices are recommended).
  • The iOS device is connected to the Internet.

2 Prerequisites

Go to ZEGOCLOUD Admin Console to create a new project, and get the AppID and AppSign of your project.

The SDK now also supports using Token for authentication, if you want to change your authentication mode, refer to the Guide for upgrading the authentication mode from using the AppSign to Token.

3 Sample source code directory structure

The following directory structure is the file structure of the ios_objc subdirectory, and the file paths mentioned below are all relative to this directory.

├─ Libs # ZegoExpressVideo iOS SDK storage directory
├─ VERSION.txt
├─ ZegoExpressExample
|    ...
│    ├─ Examples 
│    │    ├─ AdvancedAudioProcessing   # Advanced audio features
│    │    ├─ AdvancedStreaming         # Advanced stream publish and play
│    │    ├─ AdvancedVideoProcessing   # Advanced video features
│    │    ├─ CommonFeatures            # Common functions
│    │    ├─ Debug&Config              # Debug and configure
│    │    ├─ Others                    # Other functions
│    │    ├─ QuickStart                # Quick start
│    │    └─ Scenes                    # Best practices
|    ...
│    ├─ Info.plist
│    ├─ KeyCenter.h
│    ├─ KeyCenter.m # Fill in the AppID and AppSign of the application
│    ...
└─ ZegoExpressExample.xcodeproj  # Demo engineering documents

4 Run the sample source code

  1. Open AppStore, search for "Xcode", and download and install it.

  2. Open the ZegoExpressExample.xcodeproj file by using Xcode.

  3. Open Xcode and select File > Open... in the upper-left corner.

  4. In the decompressed sample source code folder, select the ZegoExpressExample.xcodeproj file and open it.

  5. Log in to your Apple developer account.

  6. Open Xcode and select Xcode > Preferences... in the upper-left corner.


  7. Click the Accounts tab, click the plus (+) icon in the lower-left corner, select Add Apple ID, and click Continue.

  8. Enter your Apple ID and password to log in.

  9. Modify the Bundle identifier and developer certificate.

  10. Open Xcode and click the "ZegoExpressExample" project on the left.

  11. Open the TARGETS option. Developers can click the General tab to modify the Bundle identifier of the project based on their needs and click the Signing & Capabilities tab to select the developer certificate.


  12. The AppID and AppSign required for SDK initialization are missing in the sample source code, and the /ZegoExpressExample/KeyCenter.m file needs to be modified. Please use the AppID and AppSign mentioned in the Prerequisites to fill in the information correctly. Otherwise, the example source code cannot run properly.


  1. Connect the iOS device to the development computer, click Any iOS Device on Xcode, and select the iOS device or simulator in the pop-up window.


  2. Click Build in the upper-left corner of Xcode to compile and run the sample source code.


5 Experience audio and video calling/live streaming function

We recommend you run your project on a real device. If your app runs successfully, you should hear the sound and see the video captured locally from your device.

To test out the real-time audio and video features, visit the ZEGO Express Web Demo, and enter the same AppID, Server and RoomID to join the same room. If it runs successfully, you should be able to view the video from both the local side and the remote side, and hear the sound from both sides as well.

In audio-only scenarios, no video will be captured and displayed.

Page Directory