Floor Access Control

In Lecture Mode, the room operates with a single publisher — the moderator — while all other participants join as listeners. When a participant wants to speak, they must request floor access from the moderator. The moderator can grant, deny, or revoke that access at any time. Alternatively, the moderator can proactively invite any participant to the floor without waiting for a request. Only one participant can hold floor access at a time.

This page covers the full floor access lifecycle: the APIs each role calls, the delegate methods that fire in response, and the error codes you may encounter.

Lecture Mode only. All floor access methods described on this page are valid only in Lecture Mode rooms. Calling any of them in a Group Mode room returns error 5067.
How Floor Access Works

There are two ways floor access can be initiated — by the participant who wants to speak, or by the moderator who wants to invite someone. Both flows end with the participant publishing their stream to the room.

Participant-Initiated Flow

This is the standard "raise your hand" pattern. The participant signals intent, and the moderator decides whether to allow it:

  1. Participant calls requestFloor — the moderator receives didFloorRequestReceived: with the requester's client ID and display name.
  2. Moderator calls grantFloor:(clientId) — the participant receives didGrantedFloorRequest: and may now publish their stream.
  3. When the participant is done speaking, they call finishFloor — the moderator receives didFinishedFloorRequest: and the floor is free for the next request.
  4. If the moderator needs to reclaim the floor before the participant finishes, they call releaseFloor:(clientId) — the participant receives didReleasedFloorRequest: and their publishing rights are revoked.

Moderator-Initiated Flow

The moderator can skip waiting for a request by directly inviting a participant to the floor. The participant then chooses to accept or decline:

  1. Moderator calls inviteToFloor:(clientId) — the targeted participant receives didInvitedForFloorAccess:.
  2. If the participant accepts, they call acceptInviteFloorRequest:(clientId) — all moderators in the room receive didAcceptedFloorInvite:.
  3. If the participant declines, they call rejectInviteFloor:(clientId) — all moderators receive didRejectedInviteFloor:.
One floor holder at a time. Before granting floor access to a second participant, the moderator must first release the floor from whoever currently holds it. Attempting to grant while another participant holds the floor returns error 5046.
Request Floor Access

A participant calls requestFloor when they want to speak. This sends a floor request to the moderator, who then sees the requester's identity and can choose to grant or deny it. The participant's stream is not published at this point — publication happens only after the moderator grants access.

Detail Value
Class EnxRoom
Method -(void)requestFloor
Caller Participant only

Delegate Methods

Delegate Fires On Description
didFloorRequestReceived:(NSArray *)data Moderator The floor request arrived. data[0] contains the requester's clientId and name.

The delegate payload at data[0] is a dictionary with the requesting participant's identity:

// data[0] structure received by the moderator:
// {
//   "clientId": "XXXX",
//   "name": "ParticipantName"
// }

Error Codes

Code Meaning
5003 Unauthorized — the caller is a moderator; only participants can request the floor.
5041 A previous request is still in progress.
5042 A floor request is already registered with the moderator.
5067 Room is in Group Mode — floor access is not applicable.
// Participant requests floor access
[room requestFloor];


// MARK: - Moderator receives the floor request

-(void)didFloorRequestReceived:(NSArray *)data {
    NSDictionary *requester = data[0];
    NSString *clientId = requester[@"clientId"];
    NSString *name     = requester[@"name"];

    // Present an approve / deny UI to the moderator
    NSLog(@"Floor requested by %@ (%@)", name, clientId);

    // Grant access
    [room grantFloor:clientId];

    // Or deny access
    // [room denyFloor:clientId];
}
Cancel a Floor Request

A participant can withdraw a floor request they previously sent, as long as the moderator has not yet acted on it. This is the "lower your hand" action — useful when the participant no longer needs the floor or the topic has moved on.

Detail Value
Class EnxRoom
Method -(void)cancelFloor
Caller Participant only

Delegate Methods

Delegate Fires On Description
room:didCancelledFloorRequest:(NSArray *)data Moderator Notifies the moderator that the participant has withdrawn their floor request.
room:didFloorCancelled:(NSArray *)data Participant ACK confirming the cancellation was processed successfully.

Error Codes

Code Meaning
5003 Unauthorized — caller is a moderator.
5041 A previous operation is still in progress.
5042 The floor request was already cancelled or does not exist.
5067 Room is in Group Mode.
Deny Floor Access

When the moderator decides not to allow a floor request, they call denyFloor: with the requesting participant's client ID. The participant is notified of the denial and their request is cleared from the queue, making the floor available for other requests.

Detail Value
Class EnxRoom
Method -(void)denyFloor:(NSString *)clientId
Caller Moderator only

Delegate Methods

Delegate Fires On Description
didDeniedFloorRequest:(NSArray *)data Participant Notifies the participant their request was denied. data[0] has result code 4117 and the denial message.
didProcessFloorRequested:(NSArray *)data Moderator ACK confirming the denial was processed.

The denial notification received by the participant at data[0]:

// data[0] received by the denied participant:
// {
//   "result": 4117,
//   "msg": "Floor Request Denied",
//   "clientId": "XXX"
// }

Error Codes

Code Meaning
5005 Unauthorized — only a moderator can deny floor requests.
5045 The specified clientId is invalid or not in the room.
5047 A deny operation is already in progress for this participant.
5048 Floor access has already been granted; use releaseFloor: instead.
5067 Room is in Group Mode.
Grant Floor Access

When the moderator approves a floor request, they call grantFloor: with the participant's client ID. Once granted, the participant receives their delegate callback and may immediately publish their stream. Remember: only one participant can hold the floor at a time. If someone else already has it, you must call releaseFloor: first.

Detail Value
Class EnxRoom
Method -(void)grantFloor:(NSString *)clientId
Caller Moderator only

Delegate Methods

Delegate Fires On Description
didGrantedFloorRequest:(NSArray *)data Participant Floor access was approved. data[0] has result code 1708. Publish your stream here.
didProcessFloorRequested:(NSArray *)data Moderator ACK confirming the grant was processed successfully.

The grant notification received by the participant at data[0]:

// data[0] received by the granted participant:
// {
//   "result": 1708,
//   "msg": "Floor Granted",
//   "clientId": "XXX"
// }

Error Codes

Code Meaning
5004 Unauthorized — only a moderator can grant floor access.
5045 The specified clientId is invalid or not in the room.
5043 A grant operation is already in progress for this participant.
5044 Floor access has already been granted to this participant.
5046 Another participant currently holds the floor — release it first.
5069 A release operation is currently in progress; wait before granting.
5067 Room is in Group Mode.
// Moderator grants floor access
[room grantFloor:@"clientId"];


// MARK: - Participant receives floor grant

-(void)didGrantedFloorRequest:(NSArray *)data {
    // Floor access confirmed — publish the local stream now
    [room publish:localStream];
}


// MARK: - Moderator ACK

-(void)didProcessFloorRequested:(NSArray *)data {
    // Floor successfully granted to the participant
    NSLog(@"Floor granted: %@", data[0]);
}
Finish Floor Access

When a participant has finished speaking, they call finishFloor to voluntarily release the floor. This signals to the moderator that the floor is free and the next pending request can be handled. The participant should also unpublish their stream at this point.

Detail Value
Class EnxRoom
Method -(void)finishFloor
Caller Participant only

Delegate Methods

Delegate Fires On Description
room:didFinishedFloorRequest:(NSArray *)data Moderator Notifies the moderator that the participant has voluntarily released the floor.
room:didFloorFinished:(NSArray *)data Participant ACK confirming the finish was processed; safe to unpublish the stream.

Error Codes

Code Meaning
5003 Unauthorized — caller is a moderator.
5041 A previous operation is still in progress.
5042 The floor session is already finished.
5067 Room is in Group Mode.
Release Floor Access

When the moderator needs to reclaim the floor from a participant — for example, because the participant is not responding or has overrun their time — they call releaseFloor:. This forcefully revokes the participant's publishing rights. You must also release the current floor holder before granting access to another participant.

Detail Value
Class EnxRoom
Method -(void)releaseFloor:(NSString *)clientId
Caller Moderator only

Delegate Methods

Delegate Fires On Description
didReleasedFloorRequest:(NSArray *)data Affected participant Notifies the participant that their floor access has been revoked. data[0] has result code 1712.
didProcessFloorRequested:(NSArray *)data Moderator ACK confirming the release was processed.

The release notification received by the affected participant at data[0]:

// data[0] received by the participant whose floor was released:
// {
//   "result": 1712,
//   "msg": "Floor Released",
//   "clientId": "XXXX"
// }

Error Codes

Code Meaning
5006 Unauthorized — only a moderator can release the floor.
5045 The specified clientId is invalid or not in the room.
5049 A release operation is already in progress for this participant.
5050 This participant does not currently hold the floor.
5067 Room is in Group Mode.
Reconnection State Recovery

If the moderator disconnects and successfully reconnects to the room, the floor request queue is not lost — EnableX preserves it in the room's metadata. After reconnecting, the moderator can read this data to restore their floor management UI exactly as it was.

Two arrays in room.roomMetaData capture the current floor state:

// Read floor state after moderator reconnects
NSArray *raisedHands   = room.roomMetaData[@"raisedHands"];    // Pending floor requests
NSArray *approvedHands = room.roomMetaData[@"approvedHands"];  // Current floor holder(s)

// Rebuild the moderator UI
for (NSString *clientId in raisedHands) {
    // Show pending floor request badge for this participant
    [self markPendingRequest:clientId];
}

for (NSString *clientId in approvedHands) {
    // Highlight this participant as currently having the floor
    [self markFloorHolder:clientId];
}
Always read raisedHands and approvedHands inside your room:didUserReconnectSuccess: delegate to ensure you are working with the latest room state.
Invite to Floor

Rather than waiting for a participant to raise their hand, the moderator can proactively invite any participant to speak. This is useful in structured sessions — for example, calling on a specific participant during a Q&A, or moving through a speaker queue in a predetermined order.

Detail Value
Class EnxRoom
Method -(void)inviteToFloor:(NSString *)clientId
Caller Moderator only

Delegate Methods

Delegate Fires On Description
didACKInviteToFloorRequested:(NSArray *)data Inviting moderator ACK confirming the invitation was sent.
didInviteToFloorRequested:(NSArray *)data All moderators in room Broadcasts the invitation event to all moderators so the floor management UI stays in sync.
didInvitedForFloorAccess:(NSArray *)data Invited participant The participant receives the invitation and can accept or reject it.

Error Codes

Code Meaning
5086 Not connected — the room connection is not active.
5097 Not available in chat-only rooms.
5006 Unauthorized — only a moderator can invite to the floor.
5045 The specified clientId is invalid or not in the room.
5067 Room is in Group Mode.
// Moderator invites a participant to the floor
[room inviteToFloor:@"clientId"];


// MARK: - Participant receives the floor invitation

-(void)didInvitedForFloorAccess:(NSArray *)data {
    // Show accept / reject dialog to the participant
    NSLog(@"You have been invited to speak");

    // Accept the invitation
    [room acceptInviteFloorRequest:@"clientId"];

    // Or decline the invitation
    // [room rejectInviteFloor:@"clientId"];
}
Cancel a Floor Invitation

If the moderator sent an invitation but wants to withdraw it before the participant has responded — for example because the session moved on — they call cancelFloorInvite:. The invited participant's pending invitation UI is dismissed, and all moderators are notified.

Detail Value
Class EnxRoom
Method -(void)cancelFloorInvite:(NSString *)clientId
Caller Moderator only

Delegate Methods

Delegate Fires On Description
didProcessFloorRequested:(NSArray *)data Moderator ACK confirming the cancellation was processed.
didCanceledFloorInvite:(NSArray *)data Invited participant & all moderators The invitation has been cancelled. Dismiss any pending invite UI.

Error Codes

Code Meaning
5086 Not connected.
5097 Not available in chat-only rooms.
5006 Unauthorized — only a moderator can cancel a floor invitation.
5045 The specified clientId is invalid or not in the room.
5067 Room is in Group Mode.
Accept a Floor Invitation

When a participant receives a floor invitation via didInvitedForFloorAccess:, they can accept it by calling acceptInviteFloorRequest:. Accepting signals readiness to speak. All moderators in the room are notified so they can update their floor management views.

Detail Value
Class EnxRoom
Method -(void)acceptInviteFloorRequest:(NSString *)clientId
Caller Participant only

Delegate Methods

Delegate Fires On Description
didProcessFloorRequested:(NSArray *)data Participant ACK confirming the acceptance was registered.
didAcceptedFloorInvite:(NSArray *)data All moderators Broadcasts the acceptance to all moderators, including the one who sent the invitation.

Error Codes

Code Meaning
5086 Not connected.
5097 Not available in chat-only rooms.
5006 Unauthorized — the caller is a moderator; only participants can accept invitations.
5045 The specified clientId is invalid or not in the room.
5067 Room is in Group Mode.
Reject a Floor Invitation

A participant can decline a floor invitation if they are not ready to speak or prefer not to participate at that moment. Calling rejectInviteFloor: notifies all moderators of the decision so they can invite another participant or move on.

Detail Value
Class EnxRoom
Method -(void)rejectInviteFloor:(NSString *)clientId
Caller Participant only

Delegate Methods

Delegate Fires On Description
didProcessFloorRequested:(NSArray *)data Participant ACK confirming the rejection was registered.
didRejectedInviteFloor:(NSArray *)data All moderators Broadcasts the rejection to all moderators so they can update the speaker queue.

Error Codes

Code Meaning
5086 Not connected.
5097 Not available in chat-only rooms.
5006 Unauthorized — the caller is a moderator; only participants can reject invitations.
5045 The specified clientId is invalid or not in the room.
5067 Room is in Group Mode.