提交工单
咨询集成、功能及报价等问题
Rooms provide basic signaling capabilities for providing orderly and reliable real-time signaling. This document describes how to manage rooms.
To obtain the room state and room info, set the delegate to self and listen for the callback receiveRoomInfoUpdate.
RoomManager.shared.roomService.delegate = self
/// Callback for the room status update
///
/// Description: This callback will be triggered when the text chat is disabled or there is a speaker seat be closed in the room. And all uses in the room receive a notification through this callback.
///
/// @param roomInfo refers to the updated room information.
func receiveRoomInfoUpdate(_ info: RoomInfo?) {
// This callback will be triggered when room info changes.
}
To receive the updates when new participants join the room or existing participants leave the room, call the addUserServiceDelegate method, and listen for the roomUserJoin and roomUserLeave callbacks.
RoomManager.shared.userService.addUserServiceDelegate(self)
/// Callback for new user joins the room
///
/// Description: This callback will be triggered when a new user joins the room, and all users in the room will receive a notification. The in-room user list data will be updated automatically.
///
/// @param userList refers to the latest new-comer user list. Existing users are not included.
func roomUserJoin(_ users: [UserInfo]) {
// This callback will be triggered when new participants join the room.
}
/// Callback for existing user leaves the room
///
/// Description: This callback will be triggered when an existing user leaves the room, and all users in the room will receive a notification. The in-room user list data will be updated automatically.
///
/// @param userList refers to the list of users who left the room.
func roomUserLeave(_ users: [UserInfo]) {
// This callback will be triggered when existing participants leave the room.
}
