Platform | Version |
Flutter | Flutter 3.27.4 and higher versions. Dart 3.6.2 or higher versions. |
Android | Android Studio 3.5 and above versions. Android devices running Android 5.0 and above versions. |
iOS | Xcode 15.0 and above versions. Ensure that your project has a deemed valid developer signature. |
flutter pub
add
tencent_live_uikit
android/app/build.gradle
file of the project:android {......buildTypes {release {......minifyEnabled trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}
proguard-rules.pro
file under the android/app
directory of the project, and add the following code in the proguard-rules.pro
file:-keep class com.tencent.** { *; }
android/app/build.gradle
file of the project.android {......defaultConfig {......multiDexEnabled true}}
Non-Global Symbols
to preserve the necessary global symbol information.ios/Podfile
file of the project:target 'xxxx' do......end......post_install do |installer|installer.pods_project.targets.each do |target|flutter_additional_ios_build_settings(target)target.build_configurations.each do |config|config.build_settings['VALID_ARCHS'] = 'arm64 arm64e x86_64'config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'endendend
<dict>
under the directory of Info.plist
in your iOS project, which correspond to the prompt messages when the system pops up the authorization dialog for the microphone and camera respectively.<key>NSCameraUsageDescription</key><string>The CallingApp requires camera permission. Video recording with picture only after enabling.</string><key>NSMicrophoneUsageDescription</key><string>The CallingApp needs to access your microphone permission. The recorded video will have sound after being enabled.</string>
post_install do |installer|installer.pods_project.targets.each do |target|flutter_additional_ios_build_settings(target)target.build_configurations.each do |config|config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)','PERMISSION_MICROPHONE=1','PERMISSION_CAMERA=1',]endendend
MateriaApp
as an example. Code as follows:import 'package:tencent_live_uikit/tencent_live_uikit.dart';return MaterialApp(navigatorObservers: [TUILiveKitNavigatorObserver.instance],localizationsDelegates: [...LiveKitLocalizations.localizationsDelegates,...BarrageLocalizations.localizationsDelegates,...GiftLocalizations.localizationsDelegates,],supportedLocales: [...LiveKitLocalizations.supportedLocales,...BarrageLocalizations.supportedLocales,...GiftLocalizations.supportedLocales],//...);
import 'package:tencent_live_uikit/tencent_live_uikit.dart';void login() async {await TUILogin.instance.login(1400000001, // Replace with the SDKAppID obtained in step 1"denny", // Replace with your UserID"xxxxxxxxxxx", // You can calculate a UserSig in the console and fill it in this position.TUICallback(onError: (code, message) {print("TUILogin login fail, {code:$code, message:$message}");},onSuccess: () async {print("TUILogin login success");},),);}
SDKAppID
and UserID
using the SecretKey
obtained in step 3 of step 1 to obtain UserSig
. It is a ticket for authentication, used by Tencent Cloud to determine whether the current user can use TRTC services.import 'package:tencent_live_uikit/tencent_live_uikit.dart';Navigator.push(context, MaterialPageRoute(builder: (context) {final String userId = 'replace with your userId';final String roomId = LiveIdentityGenerator.instance.generateId(userId, RoomType.live)return TUILiveRoomAnchorWidget(roomId: roomId);}));
Voice chat room preview screen | In-room screen of the voice chat room |
![]() | ![]() |
import 'package:tencent_live_uikit/tencent_live_uikit.dart';Navigator.push(context, MaterialPageRoute(builder: (context) {return Scaffold(body: SafeArea(child: LiveListWidget()));}));
import 'package:tencent_live_uikit/tencent_live_uikit.dart';// Single child widget, taking Container as an exampleContainer(child: LiveListWidget())// Multiple child widget, taking Column as an exampleColumn(children:[LiveListWidget()])
Live list frame | Audience in-room screen of the voice chat room |
| ![]() |