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" } ]