The RTC SDK provides an interface method for channel member management. You can obtain the remote online user list, query remote user information, and query whether a user is online. By reading this article, you can learn how to manage channel members.
Implementation method
The following table describes common channel member management methods. For more information, see AliRtcEngine interface.
-
getOnlineRemoteUsers: Obtains the list of remote online users.
Parameter descriptionvoid getOnlineRemoteUsers(AliRtc::StringArray& array)
Parameter Type Description array AliRtc::StringArray& User list (user ID list). -
getUserInfo: queries remote user information. If 0 is returned, it indicates that the acquisition is successful. If others are returned, it indicates that the acquisition fails.
Parameter descriptionint getUserInfo(const AliRtc::String& uid, AliRtc::Dictionary& dict)
Parameter Type Description uid const AliRtc::String& The ID of the user. dict AliRtc::Dictionary& Used to store user data. Valid values: In dict, key values include userID, isOnline, sessionID, callID, displayName, hasAudio,hasCameraMaster, hasCameraSlave, hasScreenSharing, requestAudio,requestCameraMaster, requestCameraSlave, requestScreenSharing, preferCameraMaster subScribedAudio, subScribedCameraMaster,subScribedCamearSlave, subScribedScreenSharing, hasCameraView, hasScreenView, and muteAudioPlaying.
Return result
0 indicates that the method call was successful. Other indicates that the method call failed.
-
isUserOnline: queries whether a user is online.
Parameter descriptionbool isUserOnline(const AliRtc::String& uid)
Parameter Type Description uid const AliRtc::String& The ID of the user. Return result
true indicates that the user is online. false indicates that the user is not online.