Host | Guest | Audience |
Host can start high-definition audio/video streaming, share screens, and manage participants. | Guest can enable their microphone for real-time voice discussions and sharing. | Supports unlimited concurrent audience entry, ultra-low latency viewing, and high-frequency chat. Audience can use "Raise Hand" to request guest access. |
![]() | ![]() | ![]() |
sudo gem install cocoapods in your terminal.sudo gem install cocoapods. Enter your administrator password as requested.pod 'TUIRoomKit' to your project's Podfile. For example:target 'YourProjectTarget' do# Other existing Pod dependencies...# Add pod 'TUIRoomKit' dependencypod 'TUIRoomKit'end
cd command in your terminal to navigate to your .xcodeproj directory, then run pod init to create a Podfile. After that, add pod 'TUIRoomKit' to your Podfile. For example:# If your project directory is /Users/yourusername/Projects/YourProject# 1. cd to your .xcodeproj project directorycd /Users/yourusername/Projects/YourProject# 2. Run pod init to generate a Podfile in your project directory.pod init# 3. Add pod 'TUIRoomKit' dependency to the generated Podfiletarget 'YourProjectTarget' do# Add pod 'TUIRoomKit' dependencypod 'TUIRoomKit'end
cd to the directory containing the Podfile, then run:pod install
Info.plist file, and provide usage descriptions that will be displayed to users when permissions are requested:<key>NSCameraUsageDescription</key><string>TUIRoomKit requires access to your camera</string><key>NSMicrophoneUsageDescription</key><string>TUIRoomKit requires access to your microphone</string>

didFinishLaunchingWithOptions method. In real-world projects, call the AtomicXCore login service only after your own user authentication and login procedures have completed. This prevents business logic conflicts and ensures seamless integration with your user management and permission systems.import AtomicXCore// AppDelegate.swiftfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {LoginStore.shared.login(sdkAppID: 1400000001, // Replace with your project's sdkAppIDuserID: "test_001", // Replace with your project's userIDuserSig: "xxxxxxxxxxx") { result in // Replace with your project's userSigswitch result {case .success(let info):debugPrint("login success")case .failure(let error):debugPrint("login failed code:\\(error.code), message:\\(error.message)")}}return true}
Parameter | Type | Description |
sdkAppID | Int32 | |
userID | String | Unique identifier for the current user. Only English letters, numbers, hyphens, and underscores are allowed. To avoid multi-device login conflicts, do not use 1, 123 or other simple IDs. |
userSig | String | Authentication ticket for Tencent Cloud. For development: Use GenerateTestUserSig.genTestSig or the UserSig Assistant Tool for a temporary UserSig.For production: Always generate UserSig server-side to prevent secret key leaks. See Calculating UserSig on the Server. |
setSelfInfo API from LoginStore:import AtomicXCorefunc setSelfInfo() {let userProfile = UserProfile(userID: "test_001", // Your logged-in userIDnickname: "tom", // Set nicknameavatarURL: "http://xxx.png") // Set avatar URLLoginStore.shared.setSelfInfo(userProfile: userProfile) { result inswitch result {case .success():debugPrint("setSelfInfo success")case .failure(let error):debugPrint("setSelfInfo failed code:\\(error.code), message:\\(error.message)")}}}
Parameter | Type | Required | Description |
userProfile | UserProfile | Yes | Core user information model, includes: userID: User ID to set. nickname: Nickname. avatarURL: Avatar link. |
completion | CompletionClosure | No | Callback for setting user info. If failed, returns error code and message. |
RoomMainView is the central interface for multi-party audio/video rooms. The following shows how to embed RoomMainView in your app as the owner.RouterContext protocol for internal navigation. Your view controller must conform to this protocol to support navigation actions (such as Exited Room and back navigation).RoomMainView lazily in your controller and set its routerContext property. This enables internal navigation via protocol methods.viewDidLoad, add RoomMainView to the view hierarchy and use constraint layout to fill the view.UINavigationController methods (push/pop). Ensure your view controller is either the root controller of a UINavigationController or part of its stack. If not, SDK navigation will fail due to the absence of a valid navigation context, resulting in page switching issues.import UIKitimport TUIRoomKitimport SnapKitimport AtomicXCore// YourMainViewController is your view controller for loading the room main pageclass YourMainViewController: UIViewController, RouterContext {let roomID = "webinar_123456"// Lazily create RoomMainView from TUIRoomKitprivate lazy var mainView: RoomMainView = {// Build entry configurationvar config = ConnectConfig()config.autoEnableCamera = true // Automatically enable camera after entering roomconfig.autoEnableMicrophone = true // Automatically enable microphone after entering roomconfig.autoEnableSpeaker = true // Automatically enable speaker after entering room// Initialize room main page as ownervar options = CreateRoomOptions()options.roomName = "xxx's Webinar" // Room namelet view = RoomMainView(roomID: roomID, behavior: .create(options: options), config: config)view.routerContext = selfreturn view}()public override func viewDidLoad() {super.viewDidLoad()// Add RoomMainView to the view controllerview.addSubview(mainView)mainView.snp.makeConstraints { make inmake.edges.equalToSuperview()}}}
Parameter | Type | Description |
roomID | String | Unique room identifier. Length: 0-48 bytes. Use only numbers, English letters (case-sensitive), underscores (_), and hyphens (-). Avoid spaces and Chinese characters. |
behavior | RoomBehavior | Source of room main page initialization. Create: Owner creates room. Requires room options. Join: Member joins room. |
config | ConnectConfig | Audio/video device control configuration after entering the room. |
Parameter | Type | Description |
autoEnableMicrophone | Bool | Automatically enable microphone after entering room. true: Enable automatically (default). false: Do not enable automatically. |
autoEnableCamera | Bool | Automatically enable camera after entering room. true: Enable automatically (default). false: Do not enable automatically. |
autoEnableSpeaker | Bool | Automatically enable speaker after entering room. true: Enable automatically (default). false: Do not enable automatically. |
Parameter Name | Type | Required | Description |
roomName | String | No | Room name, optional, defaults to empty string. Length: 0-60 bytes. Supports Chinese, English, numbers, special characters. |
password | String | No | Room password. Empty string "" means no password. Length: 0-32 bytes. Recommend 4-8 digit numbers for easy mobile input. If set, users must enter the password to join. Do not store sensitive information in plain text. Password is not supported in Webinar scenario; leave blank. |
isAllMicrophoneDisabled | Bool | No | Disable microphone for all. If enabled, only owner/admin can use microphone; guests are disabled by default. true: Disabled. false: Not disabled (default). |
isAllCameraDisabled | Bool | No | Disable camera for all. If enabled, only owner/admin can use camera; guests are disabled by default. true: Disabled. false: Not disabled (default). |
isAllScreenShareDisabled | Bool | No | Disable screen sharing for all. If enabled, only owner/admin can share screen. true: Disabled. false: Not disabled (default). |
isAllMessageDisabled | Bool | No | Disable chat messages for all (mute). If enabled, regular members cannot send text messages in the room. true: Disabled. false: Not disabled (default). |
RoomMainView in your app as a participant.RouterContext protocol for navigation. Your view controller must conform to this protocol to support navigation actions (such as Exited Room and back navigation).RoomMainView lazily in your controller and set its routerContext property. This enables internal navigation via protocol methods.viewDidLoad, add RoomMainView to the view hierarchy and use constraint layout to fill the view.webinar_.import UIKitimport TUIRoomKitimport SnapKitimport AtomicXCore// YourMainViewController is your view controller for loading the room main pageclass YourMainViewController: UIViewController, RouterContext {// Lazily create RoomMainView from TUIRoomKitprivate lazy var mainView: RoomMainView = {// Build entry configurationvar config = ConnectConfig()config.autoEnableCamera = true // Automatically enable camera after entering roomconfig.autoEnableMicrophone = true // Automatically enable microphone after entering roomconfig.autoEnableSpeaker = true // Automatically enable speaker after entering room// Initialize room main page as participantlet view = RoomMainView(roomID: "webinar_123456", behavior: .join, config: config)view.routerContext = selfreturn view}()public override func viewDidLoad() {super.viewDidLoad()// Add RoomMainView to the view controllerview.addSubview(mainView)mainView.snp.makeConstraints { make inmake.edges.equalToSuperview()}}}
RoomMainView, you will have a complete Webinar page, including member management, audio/video device control, screen sharing, live comments, video display, room information, and more. This is the core of the TUIRoomKit component.
pod install, CocoaPods will:pod install.pod 'TUIRoomKit', :git => 'https://github.com/your-username/TUIRoomKit.git', :branch => 'your-branch'
RoomMainView page is highly customizable and feature-rich. You can modify the UI to fit your business needs. The following table describes the view components within RoomMainView for quick reference.
Component | Description | Customization Suggestions |
Main room view container; manages layout and data flow for subcomponents. | Adjust background, safe area adaptation, and component visibility logic. | |
Top navigation bar; includes room info, camera/audio controls, and Exited Room button. | Replace icons, adjust background transparency, add custom buttons (e.g., recording, window mode). | |
Video stream display area. Handles Webinar streaming logic and automatically plays real-time audio/video streams of guest presenters based on user role. | Modify layout, size, empty state view, and video stream widgets. | |
Bottom toolbar; integrates microphone, camera, screen sharing, raise hand list, and member management buttons. | Rearrange button order, change button style (color, size), add business-related features (e.g., in-meeting call, beauty filter). |
TUIRoomKit.xcassets to manage UI image resources. Use Xcode's graphical tools to quickly update icons for your custom interface.
Icon | Filename | Description |
![]() | camera_close.png | Camera off icon |
![]() | camera_open.png | Camera on icon |
![]() | room_mic_off_red.png | Microphone off icon |
![]() | room_mic_on_big.png | Microphone on icon |
![]() | room_admin_tag.png | Admin icon |
![]() | room_owner_tag.png | Owner icon |

Podfile.lock and the Pods directory in your project. You can do this manually or run:# cd to the directory containing the Podfilerm -rf Pods/rm Podfile.lock
pod install --repo-update in your project directory:# cd to the directory containing the Podfilepod install --repo-update
LoginStore.shared.login once. We recommend associating LoginStore.shared.login and LoginStore.shared.logout with your own login and logout business logic.Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários