AgoraEduUserContext
AgoraEduUserContext
类。
AgoraEduUserContext
类提供的方法用于:
-
控制用户上下台行为。
-
更新用户信息和属性。
getLocalUserInfo
getCoHostList
获取所有上台用户的信息。
Objective-C
Array<AgoraEduContextUserInfo> getCoHostList()
返回值
调用成功,则返回 AgoraEduContextUserInfo
数组。
getUserList
获取指定角色的用户信息。
Objective-C
Array<AgoraEduContextUserInfo> getUserList(AgoraEduContextUserRole role)
参数
参数名 | 描述 |
---|---|
role | 用户角色,详见 |
返回值
调用成功,则返回 AgoraEduContextUserInfo
数组。
getAllUserList
获取房间内所有用户的信息。
Objective-C
Array<AgoraEduContextUserInfo> getAllUserList()
返回值
调用成功,则返回 AgoraEduContextUserInfo
数组。
updateUserProperties
新增或更新自定义用户属性。
Objective-C
void updateUserProperties(String userUuid,
Map<String, Any> properties,
Map<String, Any> cause,
Callback<Void> success,
Callback<AgoraEduContextError> fail)
详见如何设置自定义用户属性。
属性成功更新后,会触发 onUserPropertiesUpdated
回调。
参数
参数名 | 描述 |
---|---|
userUuid | 用户 ID。 |
properties | 用户属性。 |
cause | 更新原因,可为空。 |
success | 调用成功。 |
fail | 调用失败,则返回 |
deleteUserProperties
删除自定义用户属性。
Objective-C
void deleteUserProperties(String userUuid,
Array<String> keyPaths,
Map<String, Any> cause,
Callback<Void> success,
Callback<AgoraEduContextError> fail)
参数
参数名 | 描述 |
---|---|
userUuid | 用户 ID。 |
keyPaths | 你想要删除的属性的 key path,如 "key1.subkey1"。 |
cause | 删除原因,可为空。 |
success | 调用成功。 |
fail | 调用失败,则返回 |
getUserProperties
getUserRewardCount
getHandsWaveEnable
handsWave
举手申请上讲台发言。
Objective-C
void handsWave(Int duration,
Callback<Void> success,
Callback<AgoraEduContextError> fail)
参数
参数名 | 描述 |
---|---|
duration | 申请上讲台的时长,单位为秒。 |
payload | 自定义信息,可为空。 |
success | 调用成功。 |
fail | 调用失败,则返回 |
handsDown
取消举手。
Objective-C
void handsDown(Callback<Void> success,
Callback<AgoraEduContextError> fail)
参数
参数名 | 描述 |
---|---|
success | 调用成功。 |
fail | 调用失败,则返回 |