RoomContext

The RoomContext class.

joinRoom

Joins a room.

abstract fun joinRoom(callback: EduContextCallback<Unit>?)

Parameter

callback
Get the method call result asynchronously through EduContextCallback.

leaveRoom

Leaves the room.

abstract fun leaveRoom(callback: EduContextCallback<Unit>?)

Parameter

callback
Get the method call result asynchronously through EduContextCallback.

getRoomInfo

Gets the room information.

abstract fun getRoomInfo(): EduContextRoomInfo

Returns

If the method call succeeds, the SDK returns EduContextRoomInfo.

getRoomProperties

Gets custom room properties.

abstract fun getRoomProperties(): Map<String, Any>?

Returns

If the method call succeeds, the SDK returns Map<String, Any>.

updateRoomProperties

Adds or updates custom room properties.

abstract fun updateRoomProperties(properties: MutableMap<String, Any>,
                                  cause: MutableMap<String, Any>?,
                                  callback: EduContextCallback<Unit>? = null)

For details, see How can I set custom room properties?

After you successfully update the property, the SDK triggers onRoomPropertiesUpdated.

Parameter

properties
Room properties.
cause
The update reason. This parameter can be null.
callback
Get the method call result asynchronously through EduContextCallback.

deleteRoomProperties

Deletes custom room properties.

abstract fun deleteRoomProperties(keyPaths: MutableList<String>,
                                  cause: MutableMap<String, Any>?,
                                  callback: EduContextCallback<Unit>? = null)

Parameter

keyPaths
The key path of the property that you want to delete, such as key1.subkey1.
cause
The reason for deletion. This parameter can be null.
callback
Get the method call result asynchronously through EduContextCallback.