Platform | Version |
Flutter | Flutter 3.22.0 or later. Dart version 3.4.0 or higher. |
Android | Android Studio 3.5 or later. Android devices 5.0 or later. |
iOS | Xcode 13.0 or later. Please ensure that your project has a valid developer signature set. |
flutter pub
add
tencent_live_uikit
android/app/build.gradle
file:android {......buildTypes {release {......minifyEnabled trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}
proguard-rules.pro
file in 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 your project.android {......defaultConfig {...... multiDexEnabled true }}
Non-Global Symbols
to retain the necessary global symbol information.ios/Podfile
file: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
Info.plist
, under the first-level <dict>
directory, add the following two items. They correspond to the system's prompt messages when asking for microphone and camera permissions.<key>NSCameraUsageDescription</key><string>CallingApp needs to access your camera to capture video.</string><key>NSMicrophoneUsageDescription</key><string>CallingApp needs to access your microphone to capture audio.</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
import 'package:tencent_live_uikit/tencent_live_uikit.dart';......class XXX extends StatelessWidget { const XXX({super.key});@override Widget build(BuildContext context) { return MaterialApp( navigatorObservers: [TUILiveKitNavigatorObserver.instance],localizationsDelegates: [...LiveKitLocalizations.localizationsDelegates], ...... ); } }
import 'package:tencent_cloud_uikit_core/tencent_cloud_uikit_core.dart';......login() async { await TUILogin.instance.login( 1400000001, // Please replace with the SDKAppID obtained from step one"denny", // Replace it with your UserID"xxxxxxxxxxx", // Calculate a UserSig in the console and enter it here TUICallback( onError: (code, message) { print("TUILogin login fail, {code:$code, message:$message}"); }, onSuccess: () async { print("TUILogin login success"); }, ), ); }
login
function are as detailed below:SDKSecretKey
to encrypt the information such as SDKAppID
and UserID
. You can generate a temporary UserSig
on the UserSig Tools page in the console.genTestUserSig
function to calculate UserSig
locally, so as to help you complete the current integration process more quickly. However, this scheme exposes your SecretKey
in the application code, which makes it difficult for you to upgrade and protect your SecretKey
subsequently. Therefore, we strongly recommend you run the UserSig
calculation logic on the server and make the application request the UserSig
calculated in real time every time the application uses the TUILiveKit
component from the server.import 'package:tencent_live_uikit/tencent_live_uikit.dart';......Navigator.push(context, MaterialPageRoute( builder: (context) { return TUILiveRoomAnchorWidget( roomId: LiveIdentityGenerator.instance.generateId(AppStore.userId, RoomType.live)); }, ));
Video Live Preview Screen | Live video streaming with pictures |
import 'package:tencent_live_uikit/tencent_live_uikit.dart';......return Scaffold( body: SizedBox( width: _screenWidth, height: double.infinity, child: LiveListWidget(), // Adding the room list component LiveListWidget of TUILiveKit in your own widget tree ), );
|
Video Live Room | Video Live Room |
Was this page helpful?