Get Room Information
The iOS SDK provides the following properties of a connected Room:
- roomID: To provide the ID of a room.
- roomMetadata: To provide the meta information of a room.
- clientId: To provide the Client ID of a connected endpoint.
- clientName: To provide the name of a user connected through a client endpoint.
- userRole: To provide the role of a user connected to a room.
- whoami(): To provide the complete user meta information of a connected user.
- userList: To provide the list of users connected to a room.
Get a Room ID
The roomID
property provides the ID of the room you are connected to. The Room ID is assigned to each room during Room Creation.
Class: EnxRoom
Property: roomId
Sample Code
NSString* roomID= room.roomId;
Get Room Meta Informatio
The roomMetadata
property provides the meta information of a room to which you are connected. The Room Meta information JSON payload contains the complete room definition, many runtime parameters with their current values, and room statistics of connected users and streams. All the endpoints receive this information through the - room:didConnect:
delegate method after connecting to the room. The SDK internally updates some of the runtime parameters on various events.
Class: EnxRoom
Property: roomMetadata
Sample Code
NSDictionary* roomMeta = room.roomMetadata;
Get Client ID of the Connected User
The clientId
property provides the Client ID of the connected endpoint. The Client ID is unique for each user connected to the room for the session.
Class: EnxRoom
Method: clientId
Sample Code
NSString* ClientId = room.clientId;
Get Name of the Connected User
The clientName
property provides the name of the user connected through the client endpoint.
Class: EnxRoom
Method: clientName
Sample Code
NSString* ClientName = room.clientName;
Get Role of the Connected User
The userRole
property provides the role of the user connected to the room for the session, either the moderator or the participant role.
Class: EnxRoom
Method: userRole
Sample Code
NSString* role = room.userRole;
Get Information of the Connected User
The EnxRoom.whoami()
method provides the complete user meta information of the connected user.
Class: EnxRoom
Method: - (NSDictionary)Whoami;
Returns: User Meta Informationas a JSON object
Sample Code
NSDictionary* myinfo = [room Whoami];
Get a List of the Connected Users
The userList
property provides a list of users connected to the Room.
Class: EnxRoom
Property: NSArray userList
Sample Code
(NSArray)Users = room.getUserList()// Return JSON Users/*[{"clientId": "", // Unique Client ID assigned by EnableX"name": "", // User's name"user_ref": "", // User's Reference"role": "participant", // Enum: moderator, participant"permissions": { // In-Session Permission of User"publish": Boolean, // Whether user can pubish local stream"subscribe": Boolean, // Whether user can subscribe remote streams"record": Boolean, // Whether user can initiate recording"stats": Boolean, // Whether user can view stream status"controlhandlers": Boolean}}]*/