Host Prepare Page | Host Streaming Page | Live Stream List | Audience Viewing Page |
![]() | ![]() | ![]() | ![]() |
sudo gem install cocoapods command in the terminal to install.sudo gem install cocoapods installation process, you may be prompted to enter your computer's password. Enter the administrator password as prompted.pod 'TUILiveKit' dependency in your project's Podfile file. For example:target 'YourProjectTarget' do# Other existing Pod dependencies...# Addpod 'TUILiveKit'dependencypod 'TUILiveKit'end
cd command in the terminal, then execute pod init to create the Podfile. After creation, add the pod 'TUILiveKit' dependency to your Podfile. For example:# If your project directory is /Users/yourusername/Projects/YourProject# 1. cd to your.xcodeprojproject directorycd /Users/yourusername/Projects/YourProject# 2. Execute pod init. This command will generate a Podfile in your project directory.pod init# 3. Addpod 'TUILiveKit'dependency in the generatedPodfilefiletarget 'YourProjectTarget' do# Addpod 'TUILiveKit'dependencypod 'TUILiveKit'end
cd to the directory containing the Podfile in the terminal, then execute the following command to install the component.pod install
Info.plist file, and provide corresponding usage descriptions. These descriptions will be displayed to the user when the system requests permission:<key>NSCameraUsageDescription</key><string>TUILiveKit needs camera access to enable video recording with picture</string><key>NSMicrophoneUsageDescription</key><string>TUILiveKit needs microphone permission to enable sound in recorded videos</string>

//// AppDelegate.swift//// 1. Import AtomicXCoreimport AtomicXCore// 2. The example code completes login in didFinishLaunchingWithOptions. Recommendation for you: call the login service after completing your own login service.func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {// 3. Call the login APILoginStore.shared.login(sdkAppID: 1400000001, // replace with the SDKAppID from the service consoleuserID: "denny", // replace with your UserIDuserSig: "xxxxxxxxxxx") { [weak self] result in// You can calculate a UserSig in the console and fill it in this locationprint("login success")guard let self = self else { return }switch result {case .success():print("login success")case .failure(let err):print("login failed. code: \\(err.code), error:\\(err.message)")}}return true}
Parameter | Type | Description |
SDKAppID | Int | |
UserID | String | The unique ID for the current user. Must contain only English letters, numbers, hyphens, and underscores. |
userSig | String | A ticket for Tencent Cloud authentication. Please note: Development Environment: You can use the local GenerateTestUserSig.genTestSig function to generate a UserSig or generate a temporary UserSig via the UserSig Generation Tool.Production Environment: To prevent key leakage, you must use a server-side method to generate UserSig. For details, see Generating UserSig on the Server. |
LoginStore offers login status callbacks to help you handle exceptions, including "Kicked Offline" and "Signature Expired":// YourLoginService represents the business module responsible for loginclass YourLoginService: NSObject {private var cancelableSet: Set<AnyCancellable> = []// Listen to login status callbackfunc subscribeLoginStatus() {LoginStore.shared.loginEventPublisher.receive(on: RunLoop.main).sink { [weak self] loginEvent inguard let self = self else { return }switch loginEvent {case .kickedOffline: // User kicked offline callback// Your business code: UI prompt user, then log in againbreakcase .loginExpired: // User signature expired callback// Your business code: If the current user is still logged in on your backend,// you can have your app request a new userSig from your backend and call LoginStore.shared.login to renew the login status.breakdefault:break}}.store(in: &self.cancelableSet)}}
Feature | Description | Integration Guide |
Video Live Streaming | Includes a full suite of features such as host broadcasting, audience viewing, interactive co-hosting, beauty filters, gifts, and bullet chat. | |
Voice Chat Room | Includes complete business logic such as mic seat management, background music (BGM), gift interactivity, and voice room control. | |
Live Stream List | Display the live stream list interface and features, including the live stream list and room information display. |
Podfile.lock and Pods. You can choose to delete them manually or execute the following command in the terminal:// cd to the directory where Podfile is locatedrm -rf Pods/rmPodfile.lock
pod install --repo-update// cd to the directory where Podfile is locatedpod install --repo-update
TUILogin.login call. We recommend associating TUILogin.login and TUILogin.logout with your own application's login business logic.フィードバック