Run the Demo
This guide walks you through running the TUILiveKit iOS Demo in about 10 minutes. You'll experience a fully-featured live streaming solution with a complete UI. After setup, your app will look like the examples below:
Host Preview Before Going Live | Host Live Streaming | Audience Viewing | Host and Audience Co-hosting |
| | | |
Quick Experience
You can directly experience all Live features using the following methods.
Prerequisites
Enable the Service
Refer to Enable the Service to obtain a TUILiveKit trial version. Then, go to the Console for application management, and get the following:
SDKAppID: Application identifier (required). Tencent Cloud uses SDKAppId for billing and details.SDKSecretKey: Application secret key, used to initialize the configuration file with secret information.Environment Preparation
Ensure your development environment meets these requirements:
Xcode: Xcode 15 or later
iOS System: Devices running iOS 13.0 or later
Dependency management: Use Xcode's built-in Swift Package Manager (SPM) to add the LiveKit dependency.
Instructions
Get the Demo
1. Download the source code: Download the TUIKit_iOS source code from GitHub, or run:
git clone https://github.com/Tencent-RTC/TUIKit_iOS.git
2. Add the SPM dependency: Open the app project where you want to integrate TUILiveKit in Xcode, select File > Add Package Dependencies..., and enter the following repository URL in the search field:
https://github.com/Tencent-RTC/LiveKit_SwiftPM
3. Click Add Package. In the Choose Package Products dialog, select
TUILiveKit, set Add to Target to the app target where you want to integrate TUILiveKit, and click Add Package again. Afterward, confirm that TUILiveKit is listed under General > Frameworks, Libraries, and Embedded Content for that target.Setup
1. Configure SDKAppID and SDKSecretKey:In the LiveKitAccess.xcodeproj project, enter the SDKAppID and SDKSecretKey you obtained in the LiveKitAccess/GenerateTestUserSig.swift file:
Note:
In this Demo, authentication is performed by configuring
SecretKey in the client code. SecretKey can be reverse-engineered; if leaked, attackers can steal your Tencent Cloud traffic. This method is for local Demo testing and debugging only.For production, generate UserSig on your server. When needed, your app should request a dynamic UserSig from your business server. See Generating UserSig on the Server for details.
2. Configure Apple Developer Signing: Under TARGETS in your project, go to Signing & Capabilities, check Automatically manage signing, and set your Apple developer account and Bundle Identifier:
Build and Run the Demo
Live streaming scenarios require access to camera and microphone devices, so it's recommended to use a physical device for debugging and running the Demo.
1. Connect your iOS device to your computer. On the device, go to Settings > Privacy & Security > Developer Mode and enable Developer Mode.
2. In Xcode, select your test iOS device from the iOS Device dropdown at the top.
3. Click the run button to deploy the app to your target device.Note:To experience the full live streaming workflow, run the Demo on two devices and log in with two different users (for example, one device as the host and one as the audience).
Login
On the login page, enter your User ID and click Login. After a successful login, you'll be taken to the Demo home page. Use the home page entry points to explore the features shown in the sample screenshots above.
Sign-in Page | Home Page |
| |
Next Steps
After running the Demo, refer to the following integration guides to add these features to your own project:
Feature | Description | Integration Guide |
Video Live Streaming | Supports ultra-low latency HD streaming, multi-user co-hosting/PK, real-time beauty filters, bullet comments, and gift interactions—enabling you to build interactive video live streaming scenarios. | |
Voice Chat Room | Delivers ultra-clear audio quality, supports multi-user co-hosting, seat management, and real-time text chat—ideal for KTV, social, or gaming-themed rooms. |
FAQs
SPM dependency download or resolution failure?
If Xcode cannot download or resolve the Swift Package dependency, check whether your network can access GitHub. Then select File > Packages > Reset Package Caches and File > Packages > Resolve Package Versions in Xcode, and rebuild the project.
Encounter signature errors or login failures when running the Demo?
Verify that the
SDKAppID and SDKSecretKey in Debug/GenerateTestUserSig.swift are correct and match those from the Tencent Cloud Console Application Management page.Encounter error code "-3301" with the message "Services are not available in your region" after entering the room
Contact Us
If you have any questions or suggestions during integration or usage, join our Telegram technical groupor contact usfor support.
