
SDKAppID and SDKSecretKey. These credentials will be required in the subsequent login step.flutter pubaddtencent_calls_uikit
android/app/build.gradle file, ensure that ProGuard rules are configured and enabled:android {......buildTypes {release {......minifyEnabled trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}
proguard-rules.pro file in the android/app directory (if it doesn't exist) and add the following code:-keep class com.tencent.** { *; }
android/app/build.gradle file.android {......defaultConfig {......multiDexEnabled true}}
<dict> directory in your iOS project's Info.plist file:<key>NSCameraUsageDescription</key><string>CallingApp requires access to your camera to display video during calls.</string><key>NSMicrophoneUsageDescription</key><string>CallingApp requires access to your microphone to capture audio during calls.</string>
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';......class XXX extends StatelessWidget {const XXX({super.key});@overrideWidget build(BuildContext context) {return MaterialApp(navigatorObservers: [TUICallKit.navigatorObserver],......);}}
login interface.import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';import 'package:tencent_calls_uikit/debug/generate_test_user_sig.dart';......final String userID = 'xxxxx'; // Replace with the UserID for the current user (required)final int sdkAppID = 0; // Replace with the SDKAppID obtained in the previous stepfinal String secretKey = 'xxxx'; // Replace with the UserSig for the current user (required)void login() async {String userSig = GenerateTestUserSig.genTestSig(userID, sdkAppID, secretKey);TUIResult result = await TUICallKit.instance.login(sdkAppID, userID, userSig);if (result.code.isEmpty) {print('Login success');} else {print('Login failed: ${result.code} ${result.message}');}}
Parameter | Type | Description |
userID | String | Only allowing 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 and video application created in the Tencent Real-Time Communication (TRTC) Console. |
secretKey | String | The SDKSecretKey of the audio/video application created in the Tencent Real-Time Communication (TRTC) Console. |
userSig | String | A security protection signature used to authenticate user login, confirm whether the user is genuine, and prevent malicious attackers from misappropriating your cloud service usage rights. |
GenerateTestUserSig.genTestSig function to generate userSig. In this method, the SDKSecretKey is very easy to decompile and reverse engineer. Once your key is leaked, attackers can steal your Tencent Cloud traffic.setSelfInfo function to set your nickname and avatar. The set nickname and avatar will be displayed on the caller/callee interface.import 'package:tencent_calls_uikit/tencent_calls_uikit.dartvoid _setSelfInfo() {String nickname = "jack"String avatar = "https:/****/user_avatar.png"TUIResult result = TUICallKit.instance.setSelfInfo(nickname, avatar);}
Parameter | Type | Description |
nickname | String | Target user's nickname |
avatar | String | Target user's avatar |
calls function and specifying the media type (voice or video) and the callee's User ID list (userIdList). The calls interface supports both one-to-one and group calls. A one-to-one call is initiated when the userIDList contains only a single User ID; a group call is initiated when it contains multiple User IDs.import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';......void _call() {List<String> userIdList = ['vince'];TUICallMediaType mediaType = TUICallMediaType.audio;TUICallParams callParams = TUICallParams();TUICallKit.instance.calls(participantIds, mediaType, callParams);}
Parameter | Type | Description |
userIdList | List<String> | Target user ID list. |
mediaType | Media type of the call, such as video call, voice call. | |
params | Call extension parameters, such as room number, call invitation timeout, offline push custom content. |
enableFloatWindow. This feature should be enabled when initializing the TUICallKit component, with the default status being Off (false).
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';......void _enableFloatWindow() {TUICallKit.instance.enableFloatWindow(true);}
enableIncomingBanner. By default, this feature is disabled (false). When the callee receives an inbound call, the full-screen call waiting interface is shown first. When the banner is enabled, a notification banner will display initially, switching to the full-screen view as required. Note that displaying the banner requires floating window permission. The exact display behavior depends on permission settings and whether the app is running in the foreground or background. 
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';......void _enableFloatWindow() {TUICallKit.instance.enableIncomingBanner(true);}
calls method to initiate a call, if the list of called users exceeds one person, it is automatically recognized as a multi-person call. Other members can then join this multi-person call using the join method.calls method is used to initiate a call, if the callee User ID list (userIdList) contains more than one user, it will be automatically deemed a multi-person call.import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';......void _call() {List<String> userIdList = ['vince','mike'];TUICallMediaType mediaType = TUICallMediaType.audio;TUICallParams callParams = TUICallParams();TUICallKit.instance.calls(participantIds, mediaType, callParams);}
Parameter | Type | Description |
userIdList | List<String> | Target user ID list. |
mediaType | Media type of the call, such as video call, voice call. | |
params | Call extension parameters, such as room number, call invitation timeout, offline push custom content. |
join method to enter the specified multi-person call.import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';void join() {String callId = "123456";TUICallKit.instance.join(callId);}
Parameter | Type | Description |
callId | String | The unique ID for this call. |
setCallingBell interface to set the incoming call ringtone received by the callee.import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';......void _setCallingBell() {TUICallKit.instance.setCallingBell('flieName');}
Parameter | Type | Description |
fileName | String | Ringtone Name. |
enableMuteMode.import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';......void _setCallingBell() {TUICallKit.instance.enableMuteMode(true);}
calls methods by setting the iOSSound and androidSound fields within TUIOfflinePushInfo.TUIOfflinePushInfo.iOSSound parameter, which is located in the params parameter of the calls interfaces.Icon | File name | Description |
![]() | dialing.png | Answer incoming call icon |
![]() | hangup.png | Hang Up Call icon |
![]() | mute_on.png | Turn off the mic icon |
![]() | handsfree.png | Turn off the speaker icon |
![]() | camera_off.png | Camera Off icon |
![]() | add_user.png | Invite user icon during call |
info_rtc@tencent.com.Feedback