Anchor | Audience |
| |
pod 'TUILiveKit'
dependency to your Podfile
file and refer to the Example project if you run into any problems.target 'xxxx' do......pod 'TUILiveKit'end
Podfile
file, first terminal cd
into the xxxx.xcodeproj
directory and then create it with the following command:pod init
cd
to the Podfile
directory, and then run the following command to install the component.pod install
TUILiveKit
cannot be installed, You can delete Podfile.lock and Pods first。Then update the CocoaPods repository list locally by executing the following command.pod repo update
pod update
<key>NSCameraUsageDescription</key><string>TUILiveKit needs access to your camera to capture video.</string><key>NSMicrophoneUsageDescription</key><string>TUILiveKit needs access to your mic to capture audio.</string>
//// AppDelegate.swift//import TUICorefunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {TUILogin.login(1400000001, // Replace it with the SDKAppID obtained in Step 1userID: "denny", // Please replace it with your UserIDuserSig: "xxxxxxxxxxx") { // You can calculate a UserSig in the console and fill it inprint("login success")} fail: { (code, message) inprint("login failed, code: \\(code), error: \\(message ?? "nil")")}return true}
//// AppDelegate.m//#import <TUICore/TUILogin.h>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[TUILogin login:1400000001 // Replace it with the SDKAppID obtained in Step 1userID:@"denny" // Please replace it with your UserIDuserSig:@"xxxxxxxxxxx" // You can calculate a UserSig in the console and fill it insucc:^{NSLog(@"login success");} fail:^(int code, NSString * _Nullable msg) {NSLog(@"login failed, code: %d, error: %@", code, msg);}];return YES;}
SDKSecretKey
to encrypt the information such as SDKAppID
and UserID
. You can generate a temporary UserSig
by clicking the UserSig Generate button 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.let params = CreateRoomParams()parmas.maxAnchorCount = VoiceRoomDefine.MAX_CONNECTED_VIEWERS_COUNTparmas.seatMode = .applyToTakeVoiceRoomKit.createInstance().createRoom(roomId: "your room id", params: params)
CreateRoomParams *parmas = [[CreateRoomParams alloc] init];parmas.maxAnchorCount = VoiceRoomDefine.MAX_CONNECTED_VIEWERS_COUNT;parmas.seatMode = TUISeatModeApplyToTake;[[VoiceRoomKit createInstance] createRoomWithRoomId:@"your room id" params:parmas];
Voice chat room preview screen | Voice chat room in-room screen |
| |
VoiceRoomKit.createInstance().enterRoom(roomId: "your room id")
[[VoiceRoomKit createInstance] enterRoomWithRoomId:@"your room id"];
Voice Chat Room | Voice Chat Room |
| |
Was this page helpful?