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

React Native

PDF
Focus Mode
Font Size
Last updated: 2025-12-02 10:36:47
This document describes how to rapidly integrate the TUICallKit component. You can complete the following key steps within 10 minutes and obtain a complete audio and video call interface.


Preparations

Environmental Requirements

Node.js: Version 16 and above.
Device Requirements: Mobile devices running Android 5.0 and above.

Service Activation

Please refer to the Service Activation documentation to obtain the SDKAppID and SecretKey. These will be used as required parameters in the login step.

Implementation

Step 1.Importing Components

1. Install via npm/yarn: You can download the @tencentcloud/call-uikit-react-native component using the following command:
yarn add @tencentcloud/call-uikit-react-native
2. Copy Debug Files (UserSig Generation):Copy the debug directory into your project. You can use the files in this directory to locally generate userSig with your SDKAppID and SecretKey.
Method 1
Method 2
You can find them in the TUICallKit/ReactNative/src/debug directory of the GitHub repository.
From node_modules: You can get them from the @tencentcloud/call-uikit-react-native package:
MacOS
Windows
cp -r node_modules/@tencentcloud/call-uikit-react-native/src/debug ./src
xcopy node_modules\\@tencentcloud\\call-uikit-react\\src\\debug .\\src\\debug /i /e

Step 2.Login

You can introduce the login example code in App.tsx. This process performs the login for the TUI component. This step is critical; you can only use the features provided by TUICallKit after a successful login.
login
import { TUICallKit, MediaType } from '@tencentcloud/call-uikit-react-native';
import * as GenerateTestUserSig from "./debug/GenerateTestUserSig-es";

const handleLogin = async () => {
try {
const sdkAppID = 0; // Replace with the SDKAppID obtained from the console
const secretKey = ''; // Replace with the SecretKey obtained from the console
const userId = 'jack' // Replace with your UserId
const { userSig } = genTestUserSig({
SDKAppID: sdkAppID,
SecretKey: secretKey,
userID: loginUserID,
});

await TUICallKit.login({
sdkAppId: sdkAppID,
userId: loginUserID,
userSig,
});
console.log('login success');
} catch (error) {
console.error('login fail:', error);
}
};
Parameter
Type
Description
userId
String
Only allows a combination of uppercase and lowercase letters (a-z A-Z), numbers (0-9), hyphens, and underscores.
SDKAppId
int
The unique identifier SDKAppID of the audio/video application created in the Tencent RTC Console.
SecretKey
String
The SDKSecretKey of the audio/video application created in the Tencent RTC Console.
userSig
String
A security signature used to authenticate user login, verify user authenticity, and prevent malicious attackers from stealing your cloud service usage rights.
Note:
Development environment: If you are in the local development and debugging stage, you can adopt the local GenerateTestUserSig.genTestSig function to generate userSig. In this method, the secretKey is very easy to decompile and reverse engineer. Once your key is leaked, attackers can steal your Tencent Cloud traffic.
Production environment: If your project is ready to go live, implement server-side generation of UserSig.

Step 3.Set Nickname and Avatar [Optional]

Users logging in for the first time do not have avatar and nickname information. You can set the avatar and nickname using the setSelfInfo interface:
setSelfInfo

import { TUICallKit, MediaType } from '@tencentcloud/call-uikit-react-native';

const setSelfInfo = () => {
const nickName = 'mick'; // Nickname to set
const avatar = 'https:/****/user_avatar.png'; // profile photo URL to set
TUICallKit.setSelfInfo(
nickName,
avatar,
() => {
console.log('setSelfInfo success.');
},
(errCode, errMsg) => {
console.error('setSelfInfo fail:', errCode, errMsg);
}
);
};
Parameter
Type
Description
nickName
String
The nickname to be set for the target user.
avatar
String
The avatar URL to be set for the target user.

Step 4.Initiating a Call

The caller initiates an audio or video call by invoking the calls function and specifying the call type and the callee's User ID list. The calls interface supports both one-to-one and group calls. A one-to-one call is initiated when userIDList contains a single User ID; a group call is initiated when userIDList contains multiple User IDs.
calls
import { TUICallKit, MediaType } from '@tencentcloud/call-uikit-react-native';

const calls = async () => {
try {
const userIdList: string[] = ['lee', 'jane']; // called list
const mediaType = MediaType.Audio // call type
await TUICallKit.calls({
userIdList: userIdList,
mediaType,
});
console.log('calls success');
} catch (error) {
console.error('calls fail:', error);
}
};
Parameter
Type
Description
userIdList
Array<String>
The list of User IDs for the target users.
mediaType
MediaType
Media type of the call, such as video call, voice call.
MediaType.Audio :voice call.
MediaType.Video :video call.
callParams
Call extension parameters, such as room number, call invitation timeout, offline push custom content.

Step 5.Answering a Call

Once the callee has successfully logged in and the caller initiates a call, the callee will receive the call invitation, accompanied by a ringtone and vibration.

More Features

Language Settings

Supported Languages: We currently support Simplified Chinese, Traditional Chinese, English, Japanese, and Arabic.
Switching Languages: The default language of TUICallKit is consistent with the mobile operating system's language setting. If you need to switch the language, you can use the setLanguage method.
setLanguage
import { Language } from '@tencentcloud/call-uikit-react-native';

TUICallKit.setLanguage(Language.EN);
Parameter
Type
Description
language
string
Language.ZH_CN:Simplified Chinese.
Language.ZH_TW:Traditional Chinese.
Language.EN:English.
Language.AR:Arabic.
Note:
If you need to set up other languages, please contact us at info_rtc@tencent.com for assistance.

Ringtone Setting

You can configure the default ringtone, incoming call silent mode, and offline push ringtone using the following methods:
Setting Default Ringtone: Use the setCallingBell interface to set the incoming call ringtone received by the callee.
setCallingBell
import { TUICallKit, MediaType } from '@tencentcloud/call-uikit-react-native';

const setCallingBell = () => {
const filePath = 'path/to/your/bell.mp3'; // File path of the ringtone
TUICallKit.setCallingBell(filePath);
};
Details: The set ringtone must be a resource file within the main project and must be configured in the main project's pubspec.yaml file. Only local file paths are allowed. The ringtone setting is bound to the device; even if the user changes, the ringtone setting remains. To restore the default ringtone, simply pass an empty filePath.
Parameter
Type
Description
filePath
String
The path to the ringtone file.
Incoming Call Silent Mode: You can set the mute mode using enableMuteMode.
enableMuteMode
import { TUICallKit, MediaType } from '@tencentcloud/call-uikit-react-native';

TUICallKit.enableMuteMode(true);
Details: When enabled, the call request will not trigger ringtone playback.

FAQs

If you encounter any issues during integration and use, please refer to Frequently Asked Questions.

Contact Us

If you have any suggestions or feedback, please contact info_rtc@tencent.com.

Help and Support

Was this page helpful?

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

Feedback