# Manage breakout rooms > The code on this page works with either the **default UI** or the **custom UI**. Manage breakout room related functionality in the Meeting SDK for macOS. There are five distinct breakout room roles, each with its own associated interface and ability to perform certain pieces of breakout room functionality. These roles are assigned according to a combination of in-client meeting roles and the user's platform. To know when you can have a user perform a given task, listen for role changes on the `ZoomSDKNewBreakoutRoomControllerDelegate`. ## Listen for role changes To know when the current user's role has changed, extend your class with the `ZoomSDKNewBreakoutRoomControllerDelegate``. ```swift if let meetingService = ZoomSDK.shared().getMeetingService() { meetingService.getNewBreakoutRoomController().delegate = self } extension ViewController: ZoomSDKNewBreakoutRoomControllerDelegate { } ``` **ViewController.h** ```objectivec //Import the Zoom SDK library #import // Change the interface declaration to conform to the Meeting Breakout Room Delegate @interface ViewController : NSViewController { ZoomSDKMeetingService* meetingService; } ``` **ViewController.m** ```objectivec meetingService = [[ZoomSDK sharedSDK] getMeetingService]; meetingService.getNewBreakoutRoomController.delegate = self; ``` This delegate has two callbacks associated with each role. One callback indicates that the current user has been assigned that role, and the other that the user has been unassigned from the role. For example, Zoom calls onHasCreatorPermission when the meeting host has the ability to create breakout rooms. When they no longer have this ability, Zoom invokes `onLostCreatorPermission`. When a role is assigned to a user, the related callback includes a parameter for the interface that exposes the role's functionality. Store a reference to this interface when you receive the callback up until you receive a callback indicating that this role is no longer available. ## The roles These five roles let users perform the various breakout room functions. Any given user can be assigned to multiple breakout room roles at a time. - [Data](#the-data-role) (`ZoomSDKBOMeetingDataHelp`) - Access users' data in breakout rooms, including which users are assigned to various breakout rooms, users' names, and breakout rooms' names. - [Admin](#the-admin-role) (`ZoomSDKBOMeetingAdmin`) - Manages existing breakout rooms and receives help requests from users in breakout rooms. - [Creator](#the-creator-role) (`ZoomSDKBOMeetingCreator`) - Directly creates and modifies breakout rooms. The creator and admin roles are usually assigned to the same user. - [Assistant](#the-assistant-role) (`ZoomSDKBOMeetingAssistant`) - The assistant role is a minor role, similar to an attendee. Assistant role holders can join any breakout room directly without being assigned to it. - [Attendee](#the-attendee-role) (`ZoomSDKBOMeetingAttendee`) - A regular user who can join breakout rooms. ### The data role When a user receives the `onHasDataHelperPermission` callback, that user can access role-related functionality through `ZoomSDKBOMeetingDataHelp`. ```swift func onHasDataHelperPermission(_ dataHelpObject: ZoomSDKBOMeetingDataHelp?) { yourDataHelper = dataHelpObject } ``` ```objectivec - (void)onHasDataHelperPermission:(ZoomSDKBOMeetingDataHelp *)dataHelpObject { yourDataHelper = dataHelpObject; } ``` Rely on the callbacks to determine when `ZoomSDKBOMeetingDataHelp` is accessible. You can also get an instance directly. ```swift if let dataHelper = ZoomSDK.shared().getMeetingService()?.getNewBreakoutRoomController().getBOMeetingDataHelp() { yourDataHelper = dataHelper } ``` ```objectivec ZoomSDKBOMeetingDataHelp *dataHelper = [[[[ZoomSDK sharedSDK] getMeetingService] getNewBreakoutRoomController] getBOMeetingDataHelp]; if (dataHelper) { yourDataHelper = dataHelper; } ``` The breakout data role receives notifications when data is updated through `ZoomSDKNewBreakoutRoomControllerDelegate`. ```swift func onBOMeetingInfoUpdated(_ boID: String) { } func onBOListInfoUpdated() { } func onUnAssignedUserUpdated() { } ``` ```objectivec - (void)onBOMeetingInfoUpdated:(NSString *)boID { } - (void)onBOListInfoUpdated { } - (void)onUnAssignedUserUpdated { } ``` #### Data-role tasks [Get information on breakout rooms](#get-information-on-breakout-rooms), [get user information](#get-user-information) ### The admin role When a user receives the `onHasAdminPermission` callback, that user can access role-related functionality through `ZoomSDKBOMeetingAdmin`. ```swift func onHasAdminPermission(_ adminObject: ZoomSDKBOMeetingAdmin?) { yourAdminHelper = adminObject } ``` ```objectivec - (void)onHasAdminPermission:(ZoomSDKBOMeetingAdmin *)adminObject { yourAdminHelper = adminObject; } ``` Rely on the callbacks to determine when `ZoomSDKBOMeetingAdmin` is accessible. You can also get an instance directly. ```swift if let adminHelper = ZoomSDK.shared().getMeetingService()?.getNewBreakoutRoomController().getBOMeetingAdmin() { yourAdminHelper = adminHelper } ``` ```objectivec ZoomSDKBOMeetingAdmin *adminHelper = [[[[ZoomSDK sharedSDK] getMeetingService] getNewBreakoutRoomController] getBOMeetingAdmin]; if (adminHelper) { yourAdminHelper = adminHelper; } ``` The breakout admin can receive notifications when other users send a help request through `ZoomSDKBOMeetingAdminDelegate`. ```swift func onHelpRequestReceived(_ userID: String) { } func onStartBOError(_ errCode: ZoomSDKBOControllerError) { } func onBOEndTimerUpdated(_ remaining: UInt32, isTimesUpNotice: Bool) { } ``` ```objectivec - (void)onHelpRequestReceived:(NSString *)userID { } - (void)onStartBOError:(ZoomSDKBOControllerError)errCode { } - (void)onBOEndTimerUpdated:(unsigned int)remaining isTimesUpNotice:(BOOL)isTimesUpNotice { } ``` #### Admin-role tasks [Receive users' help requests](#receive-users-help-requests), [assign users to existing breakout rooms](#assign-users-to-existing-breakout-rooms), [broadcast messages into breakout rooms](#broadcast-messages-into-breakout-rooms), [invite users back into the main room](#invite-users-back-into-the-main-room), [respond to help requests from breakout rooms](#respond-to-help-requests-from-breakout-rooms), [start or stop breakout rooms](#start-or-stop-breakout-rooms) ### The creator role When a user [receives the onHasCreatorPermission callback](#the-creator-role), that user can access role-related functionality through `ZoomSDKBOMeetingCreator`. ```swift func onHasCreatorPermission(_ creatorObject: ZoomSDKBOMeetingCreator?) { yourCreatorHelper = creatorObject } ``` ```objectivec - (void)onHasCreatorPermission:(ZoomSDKBOMeetingCreator *)creatorObject { yourCreatorHelper = creatorObject; } ``` Rely on the callbacks to know when `ZoomSDKBOMeetingCreator` is accessible. You can also get an instance directly. ```swift if let creatorHelper = ZoomSDK.shared().getMeetingService()?.getNewBreakoutRoomController().getBOMeetingCreator() { yourCreatorHelper = creatorHelper } ``` ```objectivec ZoomSDKBOMeetingCreator *creatorHelper = [[[[ZoomSDK sharedSDK] getMeetingService] getNewBreakoutRoomController] getBOMeetingCreator]; if (creatorHelper) { yourCreatorHelper = creatorHelper; } ``` The creator receives notifications related to breakout room creation through `ZoomSDKBOMeetingCreatorDelegate`. ```swift func onCreateBOResponse(_ bSuccess: Bool, boID: String) { } func onWebPreAssignBODataDownloadStatusChanged(_ status: ZoomSDKPreAssignBODataStatus) { } ``` ```objectivec - (void)onCreateBOResponse:(BOOL)bSuccess boID:(NSString *)boID { } - (void)onWebPreAssignBODataDownloadStatusChanged:(ZoomSDKPreAssignBODataStatus)status { } ``` #### Creator-role tasks [Create a breakout room](#create-a-breakout-room), [manage a breakout room](#manage-a-breakout-room), [preassign users to breakout rooms](#preassign-users-to-breakout-rooms), [configure breakout rooms](#configure-breakout-rooms) ### The assistant role The assistant role is a minor role similar to an attendee. Assistant role holders can join any breakout room directly without being assigned to it. Use the `boID`, available through `ZoomSDKBOMeetingDataHelp`, to join a specific room. ```swift if let assistantHelper = ZoomSDK.shared().getMeetingService()?.getNewBreakoutRoomController().getBOMeetingAssistant() { assistantHelper.joinBO(BoID) assistantHelper.leaveBO() } ``` ```objectivec ZoomSDKBOMeetingAssistant *assistantHelper = [[[[ZoomSDK sharedSDK] getMeetingService] getNewBreakoutRoomController] getBOMeetingAssistant]; if (assistantHelper) { [assistantHelper joinBO:boID]; [assistantHelper leaveBO]; } ``` ### The attendee role When a user receives the `onHasAssistantPermission` callback, that user can access role-related functionality through `ZoomSDKBOMeetingAssistant`. ```swift func onHasAttendeePermission(_ attendeeObject: ZoomSDKBOMeetingAttendee?) { yourAttendeeHelper = attendeeObject; } ``` ```objectivec - (void)onHasAttendeePermission:(ZoomSDKBOMeetingAttendee *)attendeeObject { yourAttendeeHelper = attendeeObject; } ``` Rely on the callbacks to know when `ZoomSDKBOMeetingAttendee` is accessible. You can also get an instance directly. ```swift if let attendeeHelper = ZoomSDK.shared().getMeetingService()?.getNewBreakoutRoomController().getBOMeetingAttendee() { yourAttendeeHelper = attendeeHelper } ``` ```objectivec ZoomSDKBOMeetingAttendee *attendeeHelper = [[[[ZoomSDK sharedSDK] getMeetingService] getNewBreakoutRoomController] getBOMeetingAttendee]; if (attendeeHelper) { yourAttendeeHelper = attendeeHelper; } ``` Breakout attendees receive notifications related to the host's actions through `ZoomSDKBOMeetingAttendeeDelegate`. ```swift func onHelpRequestHandleResultReceived(_ result: ZoomSDKRequest4HelpResult) { } func onHostJoinedThisBOMeeting() { } func onHostLeaveThisBOMeeting() { } ``` ```objectivec - (void)onHelpRequestHandleResultReceived:(ZoomSDKRequest4HelpResult)result { } - (void)onHostJoinedThisBOMeeting { } - (void)onHostLeaveThisBOMeeting { } ``` #### Attendee-role tasks [Join or leave breakout rooms as an attendee](#join-or-leave-breakout-rooms-as-an-attendee), [ask for admin help](#ask-for-admin-help) ## Get information about breakout rooms Users with the **data role** can perform this task. Each breakout room is associated with an `ZoomSDKBOMeetingInfo` object and breakout ID. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasDataHelperPermission` callback](#the-data-role), access a list of breakout rooms at any time and get information about each room. ```swift guard let meetingIDList = dataHelper.getBOMeetingIDList() as? [String] else { return } for meetingID in meetingIDList { if let currentMeetingInfo = dataHelper.getBOMeetingInfo(withBOID: meetingID) { currentMeetingInfo.getBOName() currentMeetingInfo.getBOID() currentMeetingInfo.getBOUserlist() currentMeetingInfo.getBOUserStatus(withUserID: boUserID) } } ``` ```objectivec NSArray *meetingIDList = [dataHelper getBOMeetingIDList]; if (meetingIDList) { for (NSString *meetingID in meetingIDList) { ZoomSDKBOMeetingInfo *currentMeetingInfo = [dataHelper getBOMeetingInfoWithBOID:meetingID]; if (currentMeetingInfo) { [currentMeetingInfo getBOName]; [currentMeetingInfo getBOID]; [currentMeetingInfo getBOUserlist]; [currentMeetingInfo getBOUserStatusWithUserID:boUserID]; } } } ``` ## Get user information Users with the **data role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasDataHelperRightsNotification` callback](#the-data-role), get a list of unassigned users by using `unassignedUserList` to provide a list of IDs. These user IDs are specific to breakout rooms, and can be used to uniquely identify each user. Use this ID to assign that user to a breakout room or to get more data about that user. ```swift guard let unassignedUserList = dataHelper.getUnassignedUserList() as? [String] else { return } for userBOID in unassignedUserList { dataHelper.getBOUserName(withUserID: userBOID) dataHelper.isMyself(inBo: userBOID) } ``` ```objectivec NSArray *unassignedUserList = [dataHelper getUnassignedUserList]; if (unassignedUserList) { for (NSString *userBOID in unassignedUserList) { [dataHelper getBOUserNameWithUserID:userBOID]; [dataHelper isMyselfInBo:userBOID]; } } ``` To get the name of the current user's assigned breakout room, use `currentBoName`. ```swift dataHelper.getCurrentBoName() ``` ```objectivec [dataHelper getCurrentBoName]; ``` You can also get the user's name based on their breakout user ID. ```swift dataHelper.getBOUserName(withUserID: userBOID) ``` ```objectivec [dataHelper getBOUserNameWithUserID:userBOID]; ``` To see your currently assigned breakout room's name, use `boName`. ```swift attendeeHelper.getBOName() ``` ```objectivec [attendeeHelper getBOName]; ``` ## Receive users' help requests Users with the **admin role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasAdminPermission` callback](#the-admin-role), admins receive notifications through `ZoomSDKBOMeetingAdmin` when other users send a help request. ```swift func onHelpRequestReceived(_ userID: String) { } func onStartBOError(_ errCode: ZoomSDKBOControllerError) { } func onBOEndTimerUpdated(_ remaining: UInt32, isTimesUpNotice: Bool) { } ``` ```objectivec - (void)onHelpRequestReceived:(NSString *)userID { } - (void)onStartBOError:(ZoomSDKBOControllerError)errCode { } - (void)onBOEndTimerUpdated:(unsigned int)remaining isTimesUpNotice:(BOOL)isTimesUpNotice { } ``` ## Assign users to existing breakout rooms Users with the **admin role** can perform this task. To assign users to breakout rooms that haven't been started yet, see the creator-role task [Preassign users to breakout rooms](#preassign-users-to-breakout-rooms). Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasAdminPermission` callback](#the-admin-role), assign a user to an existing breakout room by using `assignNewUserToRunningBO`. The `userID` and `boID` are available through `ZoomSDKBOMeetingDataHelp`. ```swift adminHelper.assignNewUser(toRunningBO: boUserID, boid: boID) ``` ```objectivec [adminHelper assignNewUserToRunningBO:boUserID BOID:boID]; ``` To switch an already-assigned user to a different breakout room, use `switchAssignedUserToRunningBO`. The `userID` and `boID` are available through `ZoomSDKBOMeetingDataHelp`. ```swift adminHelper.switchAssignedUser(toRunningBO: boUserID, boid: boID) ``` ```objectivec [adminHelper switchAssignedUserToRunningBO:boUserID BOID:boID]; ``` ## Broadcast messages into breakout rooms Users with the **admin role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasAdminPermission` callback](#the-admin-role), broadcast a message to all breakout rooms using `broadcastMessage`. ```swift adminHelper.broadcastMessage(message) ``` ```objectivec [adminHelper broadcastMessage:message]; ``` ## Invite users back into the main room Users with the **admin role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasAdminPermission` callback](#the-admin-role), invite a specific user back into the main meeting by using `inviteBOUserReturnToMainSession`. The `userId` is available through `ZoomSDKBOMeetingDataHelp`. ```swift adminHelper.inviteBOUserReturn(toMainSession: boUserID) ``` ```objectivec [adminHelper inviteBOUserReturnToMainSession:boUserID]; ``` ## Respond to help requests from breakout rooms Users with the **admin role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasAdminPermission` callback](#the-admin-role) callback, and after receiving the `onHelpRequestReceived` callback, either accept the request and join that user's breakout room, or ignore it and stay in the current meeting. ```swift func onHelpRequestReceived(_ userID: String) { adminHelper.joinBO(byUserRequest: userID) adminHelper.ignoreUserHelpRequest(userID) } ``` ```objectivec - (void)onHelpRequestReceived:(NSString *)userID { [adminHelper joinBOByUserRequest:userID]; [adminHelper ignoreUserHelpRequest:userID]; } ``` ## Start or stop breakout rooms Users with the **admin role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasAdminPermission` callback](#the-admin-role), admins can start or stop breakout rooms for the whole meeting. ```swift if ([adminHelper canStartBO]) { [adminHelper startBO]; } [adminHelper stopBO]; ``` ```objectivec if adminHelper.canStartBO() { adminHelper.startBO() } adminHelper.stopBO() ``` ## Create a breakout room Users with the **creator role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasCreatorPermission` callback](#the-creator-role), create a single breakout room by choosing a name for the room and passing it to `createBreakoutRoom`. To batch create breakout rooms, pass a list of names into `createBO(withBONameList: array of string)`. ```swift creatorHelper.createBreakoutRoom(boName) creatorHelper.createBO(withBONameList: boNameList) ``` ```objectivec [creatorHelper createBreakoutRoom:boName]; [creatorHelper createBOWithBONameList:boNameList]; ``` Once a breakout room is created, you'll receive the `onCreateBOResponse` callback. After receiving this callback, the creator can now assign and remove users, remove a breakout room, or update the name of an existing room. The `userID` and `boID` used in these methods are available through `ZoomSDKBOMeetingDataHelp`. ### Receive breakout room creation notices Users with the **creator role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasCreatorPermission` callback](#the-creator-role), the creator receives breakout room creation notifications through `ZoomSDKBOMeetingCreatorDelegate`. ```swift func onCreateBOResponse(_ bSuccess: Bool, boID: String) { } func onWebPreAssignBODataDownloadStatusChanged(_ status: ZoomSDKPreAssignBODataStatus) { } ``` ```objectivec - (void)onCreateBOResponse:(BOOL)bSuccess boID:(NSString *)boID { } - (void)onWebPreAssignBODataDownloadStatusChanged:(ZoomSDKPreAssignBODataStatus)status { } ``` ## Manage breakout rooms Users with the **creator role** can perform these tasks. Perform any of these tasks once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasCreatorPermission` callback](#the-creator-role). ### Assign users to breakout rooms that haven't yet started ```swift creatorHelper.assignUser(toBO: boUserID, boid: boID) creatorHelper.removeUser(fromBO: boUserID, boid: boID) ``` ```objectivec [creatorHelper assignUserToBO:boUserID BOID:boID]; [creatorHelper removeUserFromBO:boUserID BOID:boID]; ``` ### Remove a breakout room from the list of available rooms Once breakout rooms are created, you can remove them from the list of available breakout rooms. The room itself is only ever deleted by Zoom's back end. Developers can't delete breakout rooms. ```swift creatorHelper.removeBO(boID) ``` ```objectivec [creatorHelper removeBO:boID]; ``` ### Change a breakout room's name ```swift creatorHelper.updateBOName(newBOName, boid: boID) ``` ```objectivec [creatorHelper updateBOName:newBOName BOID:boID]; ``` ## Preassign users to breakout rooms Users with the **creator role** can perform this task. This task lets you assign users to breakout rooms that haven't been started. To assign users to breakout rooms that are already started, see the admin-role task [Assign users to existing breakout rooms](#assign-users-to-existing-breakout-rooms). Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasCreatorPermission` callback](#the-creator-role), if the meeting allows you to preassign breakout rooms, apply those preassignments through `requestAndUseWebPreAssignBOList`. ```swift if creatorHelper.isWebPreAssignBOEnabled() { creatorHelper.requestAndUseWebPreAssignBOList() } ``` ```objectivec if ([creatorHelper isWebPreAssignBOEnabled]) { [creatorHelper requestAndUseWebPreAssignBOList]; } ``` To get updates on the creation, assignment, or preassignment of breakout rooms, use the `onWebPreAssignBODataDownloadStatusChanged` callback. ```swift func onWebPreAssignBODataDownloadStatusChanged(_ status: ZoomSDKPreAssignBODataStatus) { } ``` ```objectivec - (void)onWebPreAssignBODataDownloadStatusChanged:(ZoomSDKPreAssignBODataStatus)status { } ``` ## Configure breakout rooms Users with the **creator role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasCreatorPermission` callback](#the-creator-role), configure breakout rooms by setting the various options through a `ZoomSDKBOOption` object. - `countDown` - The number of seconds until breakout rooms automatically close for all users. - `isAttendeeCanChooseBO` - Whether attendees in a webinar can select their own breakout rooms. - `isAttendeeContained` - Whether webinar attendees are allowed to join webinar breakout rooms. - `isAutoMoveAllAssignedParticipantsEnabled` - Whether all assigned participants are automatically moved into their respective breakout room. - `isBOTimerEnabled` - Whether setting a timer for breakout rooms is enabled. - `isPanelistCanChooseBO` - Whether panelists in a webinar can select their own breakout rooms. - `isParticipantCanChooseBO` - Whether participants in a meeting can select their own breakout rooms. - `isParticipantCanReturnToMainSessionAtAnyTime` - Whether participants in a meeting can return to the main session before the admin has ended breakout rooms. - `isTimerAutoStopBOEnabled` - Whether stopping breakout rooms automatically after a set time is supported. - `isUserConfigMaxRoomUserLimitsEnabled` - Whether setting a maximum number of users per breakout room is supported. - `nUserConfigMaxRoomUserLimits` - The maximum number of users that can join a breakout room, if enabled. - `nTimerDuration` - The amount of time before breakout rooms automatically end, if enabled. After setting any of these options on the `ZoomSDKBOOption` object, update the settings by passing the option setting into the `ZoomSDKBOMeetingCreator` instance. ```swift let breakoutOption = ZoomSDKBOOption() breakoutOption.countDown = ZoomSDKBOStopCountDown_Seconds_60 let error = creatorHelper.setBOOption(breakoutOption) if error != ZoomSDKError_Success { // An error occurred during setBOOption. Please refer to the `enum ZoomSDKError` for details. } ``` ```objectivec ZoomSDKBOOption *breakoutOption = [[ZoomSDKBOOption alloc] init]; breakoutOption.countDown = ZoomSDKBOStopCountDown_Seconds_60; ZoomSDKError* error = [creatorHelper setBOOption:breakoutOption]; if (error != ZoomSDKError_Success) { // An error occurred during setBOOption. Please refer to the `enum ZoomSDKError` for details. } ``` Access the current breakout configuration through the same interface. ```swift if let currentBOOption = creatorHelper.getBOOption(), currentBOOption.isBOTimerEnabled { // Timer is enabled and can be set by the creator role } ``` ```objectivec if ([creatorHelper getBOOption]) { ZoomSDKBOOption *currentBOOption = [creatorHelper getBOOption]; if (currentBOOption.isBOTimerEnabled) { // Timer is enabled and can be set by the creator role } } ``` ## Join or leave breakout rooms as an attendee Users with the **attendee role** can perform these task. Once you have [listened for the role change](#listen-for-role-changes) and [received the `onHasAttendeePermission` callback](#the-attendee-role), join a breakout room by using `joinBO`. ```swift attendeeHelper.joinBO() ``` ```objectivec [attendeeHelper joinBO]; ``` To leave the current breakout room and return to the main meeting, use `leaveBO`. ```swift attendeeHelper.leaveBO() ``` ```objectivec [attendeeHelper leaveBO]; ``` ## Ask for admin help Users with the **attendee role** can perform this task. Once you have [listened for the role change](#listen-for-role-changes) and received the onHasAssistantPermission callback, request help from the breakout room admin by using `requestForHelp`. If the admin is already in the same breakout room as you, you don't need to send a help request. ```swift if !attendeeHelper.isHostInThisBO() { attendeeHelper.requestForHelp() } ``` ```objectivec if (!attendeeHelper.isHostInThisBO) { [attendeeHelper requestForHelp]; } ``` ---