SDK Integration Guidelines
Last updated:2022-03-22 13:06
1 Prepare The Environment
Windows:
- Unity 2018.4.8 or above.
- Visual Studio 2015 or above.
- Windows 7 or above and Windows devices that support audio and video.
- The Unity development kit of Unity 2018.4.8 or above has been installed.
- Ensure that the network connection of the running device is normal.
MacOS:
- macOS 10.0 or above and macOS device that supports audio and video.
- The Unity development kit of Unity 2018.4.8 or above has been installed.
- Ensure that the network connection of the running device is normal.
Android:
- Android device or emulator with Android version not lower than 4.1 and support audio and video (recommended to use a real device), if it is a real device, please enable the "Allow debugging" option.
- Ensure that the network connection of the running device is normal.
iOS:
- Xcode 5.0 or above, iOS 7.0 or above and an iOS device or simulator that supports audio and video (recommended to use a real device).
- Ensure that the network connection of the running device is normal.
2 Prerequisites
3 Integrated SDK
If there is no ready-made project, you can build it according to the unity official website guidelines. For details, please refer to unity official website.
If there is an existing project, follow the steps below. The integration operation of the Windows/MacOS/Android/iOS platform is similar.
3.1 New project example
Note: This step takes how to create a new project as an example. If it is integrated into an existing project, you can ignore this step.
- Open Unity, enter the project name and location, and click "Create".
After creating the project, enter the following interface:
3.2 Import SDK
Unzip the downloaded SDK.
Copy the two directories of Plugins and Scripts of the SDK to the Assets directory.
- Copy the ZegoQuickStart.cs and ConsoleLogOutput.cs files in the demo to the directory.
Drag the script to the Inspector on the right column.
3.3 Add SDK reference
Change the AppID in the ZegoQuickStart.cs file to the AppID obtained in the "Prerequisites" of this article.
// AppID and AppSign are assigned to each App by ZEGO.
// For security reasons, it is recommended to store AppSign in the business background of the App and obtain it from the background when using it.
zego_client_.InitSdk(appid, new byte[] {/* fill in the app sign here, the format is: 0x1e, 0xc3, 0xf8*/} }, user_id_, user_name);