logo
On this page

Running Example Source Code

This article describes how to quickly run the example source code and experience the basic audio and video call service.

Prepare Environment

Please ensure that your development environment meets the following technical requirements:

  • React Native 0.60 or above.
  • iOS device or simulator running iOS 12.0 or above that supports audio and video (using a real device is recommended).
  • Android device or simulator running Android 4.4 or above that supports audio and video (using a real device is recommended). If using a real device, enable the "Allow debugging" option.
  • iOS/Android device is connected to the Internet.
  • Install Node.js, and it is recommended to use the Long Term Support (LTS) version displayed on the official website homepage.

Prerequisites

You have created a project in the ZEGOCLOUD Console and applied for a valid AppID and AppSign.

Warning

The SDK also supports Token authentication. If you need to upgrade the authentication method, please refer to How to Upgrade from AppSign Authentication to Token Authentication.

Get Example Source Code

Run Example Code

  1. Use VS Code to open the project.
  2. Modify the "/App.js" file and fill in the "appID" and "appSign" required for SDK initialization.
Warning

Please fill in correctly with the AppID and AppSign obtained in the Prerequisites of this article, otherwise the example source code cannot run normally.

  1. Execute the following commands to install dependencies and start.
Warning

When executing the npm install command to install the SDK, if the download from the npm official mirror is slow, you can execute the npm set https://registry.npmmirror.com/ command to switch to the domestic mirror.

npm install
npx react-native run-android/npx react-native run-ios

Experience Video Call Features

Run the project on a real device. After running successfully, you can see the local video image.

For convenience, ZEGO provides a Web platform for debugging. On this page, enter the same AppID and RoomID, enter different UserIDs, and the corresponding Token, to join the same room and communicate with the real device. When the audio and video call starts successfully, you can hear the remote audio and see the remote video image.

Previous

Common Error Codes

Next

Integrate SDK

On this page

Back to top