Table of Contents

Lock / Unlock Room

The EnxRoom.lockRoom() method allows the Moderator to lock the Room which forbids any new user from joining the Session. The Moderator can unlock the Room using EnxRoom.unlockRoom() method to allow subsequent users to join the Session.

ClassEnxRoom

Methods:

  • - (void)lockRoom; – No Parameter required.
  • - (void)unlockRoom; – No Parameter required.

Delegate Methods:

  • – room:didAckLockRoom: – Acknowledgment to the Moderator when the Room is locked.
  • – room:didLockRoom: – Notification to all the participants in the Room when the room is locked.
  • – room:didAckUnlockRoom: – Acknowledgment to the Moderator when the Room is unlocked.
  • – room:didUnlockRoom: – Notification to all the participants in the Room when the room is unlocked.
[room lockRoom];

// Moderator is acknowledged that room has been locked 
- (void)room:(EnxRoom *_Nullable)room didAckLockRoom:(NSArray *_Nullable)data;

// Participants are notified that room has been locked
- (void)room:(EnxRoom *_Nullable)room didLockRoom:(NSArray *_Nullable)data;

 
[room unlockRoom];

// Moderator is acknowledged that room has been unlocked 
- (void)room:(EnxRoom *_Nullable)room didAckUnlockRoom:(NSArray *_Nullable)data;

// Participants are notified that room has been unlocked
- (void)room:(EnxRoom *_Nullable)room didUnlockRoom:(NSArray *_Nullable)data;

Error Codes / Exceptions

CodeDescription
5115Unauthorized Access. When a user with participant role invokes lockRoom() or unlockRoom().
5117Invalid request. When the Moderator invokes lockRoom() on a locked Room.
5118Invalid request. When the Moderator invokes unlockRoom() on an unlocked Room.

Moderate Participant’s entry to a Session

In a knock-enabled Room, a user needs to wait until the Moderator grants them permission to join the Session. The EnxRoom.approveAwaitedUser() method allows the Moderator to approve a user’s entry and EnxRoom.denyAwaitedUser() method is used to decline a user’s entry to the Session.

Methods:

  • -approveAwaitedUser:clientID
  • -denyAwaitedUser: clientID

Parameters:

  • clientID: Client ID of the user awaiting the Moderator’s approval.

Delegate Methods:

  • - room:diduserAwaited – Notification to the Moderator when a user awaits their permission to join Room.
  • - room:didRoomAwaited – Notification to the user when they await Moderator’s permission to connect Room with { “event_type”: “knock” } in the JSON Payload.
  • - room:didAckForApproveAwaitedUser – Acknowledgment to the Moderator when the user is granted permission to join Room.
  • - room:didConnect – Notification to the user when the user is permitted to join Room.
  • - room:didAckForDenyAwaitedUser – Acknowledgment to the Moderator when the user is denied permission to join Room.
  • - room:didRoomDisconnect – Notification to the user along with a reason for denial when the user is denied access to the Room.
// Moderator is notified about awaited user
-(void)room:(EnxRoom *_Nullable)room diduserAwaited:(NSArray *_Nullable)data  {
	// Awaited Client Info in the data, e.g.
	// [{"id","String", "name": "String”}] 
	
	[room approveAwaitedUser:id];  // To allow

	[room denyAwaitedUser:id]; // To deny
	 
};

-(void)room:(EnxRoom *_Nullable)room didAckForApproveAwaitedUser:(NSArray *_Nullable)data; 
{	// User has been allowed entry	
}

-(void)room:(EnxRoom *_Nullable)room didAckForDenyAwaitedUser:(NSArray *_Nullable)data {
	// User has been denied entry	
}

To manage awaited users when moderator joins late

If the Moderator joins after the participant(s) have sent a request to join the Session in a Knock-enabled Room, then the Moderator can get the list of participants awaiting approval using room.awaitedParticipants. You can utilize this attribute to build UI for Moderator controls to handle pending approvals.

// e.g. room.awaitedParticipants

[
	{	"clientId”: "String", 
		"name": "String" 
	}
]