{"id":4509,"date":"2021-11-24T20:56:24","date_gmt":"2021-11-24T12:56:24","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4509"},"modified":"2025-04-05T02:42:26","modified_gmt":"2025-04-04T18:42:26","slug":"participant-role-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/participant-role-switch\/","title":{"rendered":"Participant Role Switch: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<p>The <code>EnxRoom.switchUserRole()<\/code> method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>:  <code>- (void)switchUserRole:(NSString *)clientId;<\/code> <code> <\/code><\/p>\n\n\n\n<p><strong>Parameter<\/strong>: <\/p>\n\n\n\n<p><code>clientId<\/code> &#8211; Client ID of the participant who is being designated as Moderator.<\/p>\n\n\n\n<p><strong>Delegate Methods:<\/strong><\/p>\n\n\n\n<ul><li><code>- room:didSwitchUserRole: <\/code>\u2013 Acknowledgment to the Moderator when a Switch User Role is requested.<\/li><li><code>- room:didUserRoleChanged:<\/code> &#8211; Notification to the new Moderator when their role is changed from Participant to Moderator.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Switching user with ClientId to Moderator Role\n[_remoteRoom switchUserRole:@\"clientId\"];\t\n\n- (void)room:(EnxRoom *)room didSwitchUserRole:(NSArray *)data {\n\t\/\/ Modeator is acknowledged \n}\n\n- (void)room:(EnxRoom *)room didUserRoleChanged:(NSArray *)data {\n\t\/\/ New Modeator is notified that \n\t\/\/ his role is promoted to Moderator\n}<\/pre>\n\n\n\n<p><strong>Error Codes \/ 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>5085<\/td><td>Unauthorized Access. When a user with <code>participant<\/code> role invokes <code>switchUserRole()<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\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=\"..\/destroy-session\/\">Destroy Session<\/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=\"..\/break-out-room\/\">Break-Out Room<\/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>The EnxRoom.switchUserRole() method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired. Class: EnxRoom Method: &#8211; (void)switchUserRole:(NSString *)clientId; Parameter: clientId &#8211; Client ID of the participant who is being&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3732,"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":"The EnxRoom.switchUserRole() method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired. Class: EnxRoom&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4509"}],"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=4509"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4509\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3732"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}