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.

    void getOnlineRemoteUsers(AliRtc::StringArray& array)
    Parameter description
    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.

    int getUserInfo(const AliRtc::String& uid, AliRtc::Dictionary& dict)
    Parameter description
    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.

    bool isUserOnline(const AliRtc::String& uid)
    Parameter description
    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.