tencent cloud

Tencent Real-Time Communication

소식 및 공지 사항
제품 업데이트
Tencent Cloud 오디오/비디오 단말 SDK 재생 업그레이드 및 권한 부여 인증 추가
TRTC 월간 구독 패키지 출시 관련 안내
제품 소개
제품 개요
기본 개념
제품 기능
제품 장점
응용 시나리오
성능 데이터
구매 가이드
Billing Overview
무료 시간 안내
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
과금 FAQ
Refund Instructions
신규 사용자 가이드
Demo 체험
Call
개요(TUICallKit)
Activate the Service
Run Demo
빠른 통합(TUICallKit)
오프라인 푸시
Conversational Chat
온클라우드 녹화(TUICallKit)
AI Noise Reduction
UI 사용자 정의
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
릴리스 노트
FAQs
라이브 스트리밍
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
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 다운로드
API 코드 예시
Usage Guidelines
API 클라이언트 API
고급 기능
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
콘솔 가이드
애플리케이션 관리
사용량 통계
모니터링 대시보드
개발 보조
Solution
Real-Time Chorus
FAQs
과금 개요
기능 관련
UserSig 관련
방화벽 제한 처리
설치 패키지 용량 축소 관련 질문
Andriod 및 iOS 관련
Web 관련
Flutter 관련
Electron 관련
TRTCCalling Web 관련
멀티미디어 품질 관련
기타 질문
Protocols and Policies
컴플라이언스 인증
보안 백서
정보 보안에 관한 참고 사항
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
용어집

React Native

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 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.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백