All Products
Search
Document Center

ApsaraVideo Live:Run ARTC demo project for iOS

Last Updated:Aug 14, 2025

This topic describes how to run the demo project of ApsaraVideo Real-time Communication (ARTC) to try out ARTC features on iOS.

Download source code

ApsaraVideo Live provides open-source sample projects to demonstrate the API usage of ARTC SDK, helping developers understand and integrate the ARTC features. To download the source code, visit GitHub repository.

Environment requirements

Before running the demo project, ensure your development environment meets the following requirements:

  • Development tool: Xcode 14.0 or later. The latest official version is recommended.

  • Recommended configuration: CocoaPods 1.9.3 or later.

  • Test device: A device running iOS 9.0 or later.

Note

We recommend using physical devices for testing, as emulators may not support all features.

  • Network: A stable Internet connection.

  • Application setup: Obtain the AppID and AppKey of the ARTC application.

Procedure

Step 1: Get the demo project

Clone the ARTC demo project to your local device:

git clone https://github.com/MediaBox-Demos/amdemos-artc
Note

This repository contains demo projects for multiple native platforms. The iOS demo project is located in the iOS/ directory.

The demo project includes code for generating tokens on the client side. This is for demonstration and testing purposes only. In a production environment, tokens must be generated on a secure server to protect your AppKey.

File structure of the iOS/ARTCExample project:

├── iOS                                    // Root directory for iOS project
│   ├── ARTCExample                        // API Example project directory
│       ├── Common                         // Common module
│           ├── ARTCTokenHelper.swift      // AppId and AppKey information
│           ├── ...                        // Other files
│       ├── QuickStart                     // Quick start module
│           ├── TokenGenerate              // Token generation and channel joining
│           ├── VideoCall                  // Quick implementation of audio/video call
│           ├── VoiceChat                  // Quick implementation of voice chat room
│       ├── Setting                        // Settings module
│       ├── ...                            // Other project files
│   ├── ARTCExample.xcodeproj              // Xcode project file for the demo
│   ├── ARTCExample.xcworkspace            // Xcode workspace for the demo
│   ├── Podfile                            // Demo podfile

Step 2: Configure the demo project

  1. After downloading the source code, open the iOS directory in the terminal.

  2. In the iOS directory, run the command pod install --repo-update to install the the required SDK dependencies.

  3. Open the ARTCExample.xcworkspace file in Xcode.

  4. Navigate to the iOS/ARTCExample/Common/ARTCTokenHelper.swift file and enter the AppID and AppKey obtained from the console.

// ARTCTokenHelper.swift
class ARTCTokenHelper: NSObject {
    /**
     * RTC AppId
     */
    public static let AppId = "<AppID of your ARTC application>"
    /**
     * RTC AppKey
     */
    public static let AppKey = "<AppKey AppID of your ARTC application>"
    
    ...
}

Step 3: Compile and run the demo project

  1. Select the ARTCExample Target, connect a physical device to your computer, and compile to install the application.

  2. Run the application on the test device to try out the ARTC features.

On the test device, open the application and tap Video Call to test this feature.

image

To test video call, use the same channel ID to join the call on two devices.

image.png

The call starts, and you can see the video streams from both devices.

image.png