{"id":5008,"date":"2021-12-21T15:15:08","date_gmt":"2021-12-21T07:15:08","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=5008"},"modified":"2022-04-11T19:13:05","modified_gmt":"2022-04-11T11:13:05","slug":"room-entry-restriction","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/room-entry-restriction\/","title":{"rendered":"Room Entry Restriction: React Native SDK &#8211; Video API"},"content":{"rendered":"\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#lock-unlock-room\">Lock \/ Unlock Room<\/a><\/li><li><a href=\"#allow-deny-room-entry\">Moderate Participant Entry to Session<\/a><\/li><\/ul>\n\n\n\n<a name=\"lock-unlock-room\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Lock \/ Unlock Room<\/h2>\n\n\n\n<p>The&nbsp;<code>Enx.lockRoom()<\/code>&nbsp;method allows the Moderator to lock the Room which forbids any new user from joining the Session. The Moderator can unlock the Room using <code>Enx.unLockRoom()&nbsp;<\/code>method to allow subsequent users to join the Session.<\/p>\n\n\n\n<p><strong>Class<\/strong>:&nbsp;<code>Enx<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong><\/p>\n\n\n\n<ul><li><code>Enx.lockRoom()<\/code> \u2013 No Parameter required.<\/li><li><code>Enx.unLockRoom()<\/code> \u2013 No Parameter required.<\/li><\/ul>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>ackLockRoom<\/code> <code>-<\/code> Acknowledgment to the Moderator when the Room is locked.<\/li><li><code>lockedRoom<\/code> <code>-<\/code>&nbsp;Notification to all the participants in the Room when the room is locked.<\/li><li><code>ackUnLockRoom<\/code> <code>-<\/code>&nbsp;Acknowledgment to the Moderator when the Room is unlocked.<\/li><li><code>unLockedRoom<\/code> <code>-<\/code>&nbsp;Notification to all the participants in the Room when the room is unlocked.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.lockRoom().       \/\/Lock room \nEnx.unLockRoom().    \/\/Unlock room\n\nackLockRoom:event=&gt;{\n       \/\/ Moderator is acknowledged that room has been locked\n              }\nlockedRoom:event=&gt;{\n       \/\/ Participants are notified that room has been locked\n              }\nackUnLockRoom:event=&gt;{\n      \/\/ Moderator is acknowledged that room has been unlocked\n              }\nunLockedRoom:event=&gt;{\n        \/\/ Participants are notified that room has been unlocked\n              }<\/pre>\n\n\n\n<p><strong>Error Codes &amp; Exceptions<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5115<\/td><td>Unauthorized Access. When a user with <code>participant<\/code> role invokes <code>lockRoom()<\/code> or <code>unlockRoom()<\/code>.<\/td><\/tr><tr><td>5117<\/td><td>Invalid request. When the Moderator invokes <code>lockRoom()<\/code> on a locked Room. <\/td><\/tr><tr><td>5118<\/td><td>Invalid request. When the Moderator invokes <code>un<code>lockRoom()<\/code><\/code> on an unlocked Room.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<a name=\"allow-deny-room-entry\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Moderate Participants&#8217; entry to a Session<\/h2>\n\n\n\n<p>In a <a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-room\">knock-enabled Room,<\/a> a user needs to wait until the Moderator grants them permission to join the Session.  The <code>Enx.approveAwaitedUser()<\/code> method allows the Moderator to approve a user&#8217;s entry and <code>Enx.denyAwaitedUser()<\/code> method is used to decline a user&#8217;s entry to the Session.<\/p>\n\n\n\n<p><strong>Methods: <\/strong><\/p>\n\n\n\n<ul><li><code>Enx.approveAwaitedUser(clientId)<\/code><\/li><li><code>Enx.denyAwaitedUser(clientId)<\/code><\/li><\/ul>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>clientId<\/code>:  Client ID of the user awaiting the Moderator&#8217;s approval. <\/li><\/ul>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>userAwaited<\/code> &#8211; Notification to the Moderator when a user awaits their permission to join Room.<\/li><li><code>roomAwaited<\/code> &#8211; Notification to the user when they await Moderator&#8217;s permission to join Room with { &#8220;event_type&#8221;: &#8220;knock&#8221; } in the JSON Payload.<\/li><li><code>ackForApproveAwaitedUser<\/code> &#8211; Acknowledgment to the Moderator when the user is granted permission to join Room.<\/li><li><code>roomConnected<\/code> &#8211; Notification to the user when the user is permitted to join Room.<\/li><li><code>ackForDenyAwaitedUser<\/code> &#8211; Acknowledgment to the Moderator when the user is denied permission to join Room. <\/li><li><code>roomDisconnected<\/code> &#8211; Notification to the user along with a reason for denial when the user is denied access to the Room. <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.approveAwaitedUser(clientId)\nEnx.denyAwaitedUser(clientId)\n\nuserAwaited:event=&gt;{\n   \/\/ Moderator is notified about awaited user\n              }\nroomAwaited:event=&gt;{\n     \/\/ Notification to the user when they await Moderator\u2019s permission to join Room\n              }\nackForApproveAwaitedUser:event=&gt;{\n    \/\/ User has been allowed entry\n              }\nackForDenyAwaitedUser:event=&gt;{\n    \/\/ User has been denied entry\n              }<\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>\u2190 <a href=\"..\/hard-muting\/\">Hard Muting<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/disconnect-user\/\"><\/a><a href=\"..\/disconnect-user\/\">Disconnect User<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents Lock \/ Unlock Room Moderate Participant Entry to Session Lock \/ Unlock Room The&nbsp;Enx.lockRoom()&nbsp;method allows the Moderator to lock the Room which forbids any new user from joining the Session. The Moderator can unlock the Room using Enx.unLockRoom()&nbsp;method to allow subsequent users to join the Session. Class:&nbsp;Enx Methods: Enx.lockRoom() \u2013 No Parameter required. Enx.unLockRoom() \u2013 No Parameter required. Callbacks: ackLockRoom &#8211; Acknowledgment to the Moderator when the&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3747,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"Table of Contents Lock \/ Unlock Room Moderate Participant Entry to Session Lock \/ Unlock Room The&nbsp;Enx.lockRoom()&nbsp;method allows the Moderator to lock the Room which forbids any new user from joining the Session. The Moderator can unlock the Room using Enx.unLockRoom()&nbsp;method to allow subsequent users to join the Session. Class:&nbsp;Enx Methods: Enx.lockRoom() \u2013 No Parameter&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5008"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=5008"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5008\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3747"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=5008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}