tencent cloud

Tencent Real-Time Communication

Release Notes and Announcements
Release Notes
Recent Product Announcement
TRTC Live (TUILiveKit) Product Launch Announcement
TRTC Conference Official Editions Launched
The commercial version of Conference is coming soon
Terms and Conditions Applicable to $9.9 Starter Package
Rules for the "First Subscription $100 Discount" Promotion
Announcement on the Start of Beta Testing for Multi-person Audio and Video Conference
TRTC Call Official Editions Launched
License Required for Video Playback in New Version of LiteAV SDK
TRTC to Offer Monthly Packages
Product Introduction
Overview
Concepts
Features
Strengths
Use Cases
Performance Statistics
Tencent RTC Quickplay: Experience Ultimate Real-Time Audio and Video Interaction!
Purchase Guide
Billing Overview
Free Minutes
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
FAQs
Refund Instructions
User Tutorial
Free Demo
Call
Overview
Activate the Service
Run Demo
Integration
Offline Call Push
Conversational Chat
On-Cloud Recording
AI Noise Reduction
UI Customization
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
Release Notes
FAQs
Conference
Overview(TUIRoomKit)
Activate the Service (TUIRoomKit)
Run Demo(TUIRoomKit)
Integration(TUIRoomKit)
Screen Sharing (TUIRoomKit)
Schedule a meeting (TUIRoomKit)
In-meeting Call (TUIRoomKit)
UI Customization(TUIRoomKit)
Virtual Background (TUIRoomKit)
Conference Control (TUIRoomKit)
Cloud Recording (TUIRoomKit)
AI Noise Reduction (TUIRoomKit)
In-Conference Chat (TUIRoomKit)
Robot Streaming (TUIRoomKit)
Enhanced Features (TUIRoomKit)
Client APIs (TUIRoomKit)
Server APIs (TUIRoomKit)
FAQs (TUIRoomKit)
Error Code (TUIRoomKit)
SDK Update Log (TUIRoomKit)
Live
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Run Demo
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK Download
API Examples
Usage Guidelines
API Reference Manual
Advanced Features
AI Integration
Overview
Configure MCP Server
Install Skills
Integration Guide
FAQ
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
Console Guide
Application Management
Package Management
Usage Statistics
Monitoring Dashboard
Development Assistance
Solution
Real-Time Chorus
FAQs
Migration Guide
Billing
Features
UserSig
Firewall Restrictions
How to Downsize Installation Package
Android and iOS
Web
Flutter
Electron
TRTCCalling for Web
Audio and Video Quality
Others
Legacy Documentation
RTC RoomEngine SDK(Old)
Integrating TUIRoom (Web)
Integrating TUIRoom (Android)
Integrating TUIRoom (iOS)
Integrating TUIRoom (Flutter)
Integrating TUIRoom (Electron)
TUIRoom APIs
On-Cloud Recording and Playback (Old)
RTC Analytics Monthly Packages (Previous Version)
Protocols and Policies
Compliance
Security White Paper
Notes on Information Security
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC Policy
Privacy Policy
Data Processing And Security Agreement
Glossary

Unity

PDF
Focus Mode
Font Size
Last updated: 2025-08-04 17:09:22
This document shows you how to integrate the TRTC SDK in Unity to enable audio/video calls in games.
The demo includes the following features:
Room entry/exit
Custom video rendering
Device management and music/audio effects
Note
For details about the APIs and their parameters, see Overview.
Unity 2022.3.13f1 is recommended.
Supported platforms: Android, iOS, Windows, macOS (alpha testing)
Modules required: Android Build Support, iOS Build Support, Windows Build Support, MacOS Build Support .
If you are developing for iOS, you also need:
Xcode 11.0 or later
A valid developer signature for your project

Directions

Step 1. Create an application

1. Log in to the TRTC console overview page, click Create Application.
2. In the popup page, select RTC Engine, enter the application name, and then click Create.


Step 2. Get your SDKAppId and SecretKey

After your application created, you can get your SDKAppID and SDKSecretKey on Basic informaction. SDKAppID and SDKSecretKey is needed for running demo.


Step 3. Download the sample code

1. Go to GitHub to download the SDK and demo source code.
git clone https://github.com/LiteAVSDK/TRTC_Unity.git
2. The steps to import SDK can refer to Unity SDK import.

Step 4. Configure the project

Open the file downloaded previously, find and open TRTC-Simple-Demo/Assets/TRTCSDK/Demo/TRTC/Tools/GenerateTestUserSig.cs, and set the relevant parameters in GenerateTestUserSig.cs:
SDKAPPID: A placeholder by default. Set it to the actual SDKAppID.
SDKSECRETKEY: A placeholder by default. Set it to the actual key.
Note
The method for generating UserSig described in this document involves configuring SDKSECRETKEY in the client code. In this method, SDKSECRETKEY may be easily decompiled and reversed, and if your key is disclosed, attackers can steal your Tencent Cloud traffic. Therefore, this method is only suitable for the local execution and debugging of TRTC-Simple-Demo.
The best practice is to integrate the calculation code of UserSig into your server and provide an application-oriented API. When UserSig is needed, your application can send a request to your server for a dynamic UserSig. For more information, see How do I calculate UserSig during production.

Step 5. Compile and run the demo

Android

1. Open Unity Editor, go to File > Build Settings, and select Android for Platform.

2. Connect to a real Android device and click Build And Run to run the demo.
3. Call enterRoom first and go on to test other APIs. The data display window shows whether the call is successful, and the other window displays the callback information.

iOS

1. Open the TRTC build and configuration tool (from the menu at the top).
2. Click Build & Configure iOS to generate a project.

3. Find the TRTC-Simple-Demo/Builds/iOS/TRTCUnityDemo directory, and open the project generated (Unity-iPhone.xcodeproj) with Xcode.
4. Configure the signature information.
5. Connect to a real iOS device to debug the project.

Windows

1. Open Unity Editor, go to File > Build Settings, and select PC, Mac & Linux Standalone for Platform, and Windows for Target Platform.

2. Click Build And Run to run the demo.

macOS

1. Open Unity Editor, go to File > Build Settings, and select PC, Mac & Linux Standalone for Platform, and macOS for Target Platform.

2. Click Build And Run to run the demo.

Demo

The demo integrates most of the APIs launched so far, which can be used for testing and as reference for API calls. For more information about APIs, see Client APIs > Unity > Overview.
Note
The UI of the latest version of the demo may look different.

Directory Structure

├─Assets
├── Editor // Unity Editor script
│ ├── FixAppSign.cs // Unity iOS Signature Configuration
├── Plugins
│ ├── Android
│ │ ├── AndroidManifest.xml //Android configuration file
├── StreamingAssets // Audio/Video stream files for the Unity demo
├── TRTCSDK
├── Demo // Unity Demo
├── Editor
│ ├── AppleConfigProject.cs // Unity Build Configuration Tool for iOS
│ ├── BuildScript.cs // Unity navigation bar adds shortcut buttons for building different platforms
│ └── IOSAddDylib.cs // Unity Build TRTC library file addition and configuration for iOS platform
├── SDK // TRTC Unity SDK
├── Plugins // Store library files of TRTC SDK for Unity for different platforms
├── Scripts // Header files of TRTC SDK for Unity
├── Implement // Implementation layer code file of TRTC SDK for Unity
├── Include // Header files code file of TRTC SDK for Unity


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback