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: - (void)switchUserRole:(NSString *)clientId;

Parameter:

clientId – Client ID of the participant who is being designated as Moderator.

Delegate Methods:

  • - room:didSwitchUserRole: – Acknowledgment to the Moderator when a Switch User Role is requested.
  • - room:didUserRoleChanged: – Notification to the new Moderator when their role is changed from Participant to Moderator.
// Switching user with ClientId to Moderator Role
[_remoteRoom switchUserRole:@"clientId"];	

- (void)room:(EnxRoom *)room didSwitchUserRole:(NSArray *)data {
	// Modeator is acknowledged 
}

- (void)room:(EnxRoom *)room didUserRoleChanged:(NSArray *)data {
	// New Modeator is notified that 
	// his role is promoted to Moderator
}

Error Codes / Exceptions:

CodeDescription
5085Unauthorized Access. When a user with participant role invokes switchUserRole()