AgoraEduUserContext

The AgoraEduUserContext class.

The methods provided by the AgoraEduUserContext class are used for:
  • Controlling the user's behavior of "going on and off stage".
  • Updating user information and properties.

getCoHostList

Gets the information of all users on the "stage".

Array<AgoraEduContextUserInfo> getCoHostList()

Returns

If the method call succeeds, the SDK returns an array of AgoraEduContextUserInfo.

getAllUserList

Gets the information of all users in the room.

Array<AgoraEduContextUserInfo> getAllUserList()

Returns

If the method call succeeds, the SDK returns an array of AgoraEduContextUserInfo.

updateUserProperties

Adds or updates custom user properties.

void updateUserProperties(String userUuid,
                          Map<String, Any> properties,
                          Map<String, Any> cause,
                          Callback<Void> success,
                          Callback<AgoraEduContextError> fail)

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

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

Parameter

userUuid
The user ID.
properties
The user properties.
cause
The update reason, which can be empty.
success
The method call succeeds.
fail
If the method call fails, the SDK returns AgoraEduContextError.

deleteUserProperties

Deletes custom user properties.

void deleteUserProperties(String userUuid,
                          Array<String> keyPaths,
                          Map<String, Any> cause,
                          Callback<Void> success,
                          Callback<AgoraEduContextError> fail)

Parameter

userUuid
The user ID.
keyPaths
The key path of the property that you want to delete, such as "key1.subkey1".
cause
The reason for deletion, which can be empty.
success
The method call succeeds.
fail
If the method call fails, the SDK returns AgoraEduContextError.

getUserProperties

Gets the custom properties of the specified user.

Map<String, Any> getUserProperties(String userUuid)

Parameter

userUuid
The user ID.

Returns

If the method call succeeds, the SDK returns the custom user properties.

getUserRewardCount

Gets the number of rewards owned by the specified user.

Int getUserRewardCount(String userUuid)

Parameter

userUuid
The user ID.

Returns

If the method call succeeds, the SDK returns the number of rewards.

getHandsWaveEnable

Checks whether the "raising a hand" feature is enabled.

Bool getHandsWaveEnable()

Checks whether the students in the current room can "raise their hands" to apply for speaking on the "stage".

Returns

If the method call succeeds, the SDK returns the result.

handsWave

Raises the hand to apply for speaking on the "stage".

void handsWave(Int duration,
               Callback<Void> success,
               Callback<AgoraEduContextError> fail)

Parameter

duration
The duration of the application (seconds).
payload
Custom information, which can be empty.
success
The method call succeeds.
fail
If the method call fails, the SDK returns AgoraEduContextError.

handsDown

Puts down the hand.

void handsDown(Callback<Void> success,
               Callback<AgoraEduContextError> fail)

Parameter

success
The method call succeeds.
fail
If the method call fails, the SDK returns AgoraEduContextError.