Android

更新时间:
复制 MD 格式

RTC SDK provides methods to allow you to manage channel members. You can obtain the list of remote online users, query remote user information, and query whether a user is online. This topic describes how to manage channel members.

Implementation methods

You can use the following methods to manage channel members. For more information, see AliRtcEngine interface.

  • getOnlineRemoteUsers: Obtains the list of remote online users.

    public abstract String[] getOnlineRemoteUsers()                

    Return result

    Returns a list of user IDs.

    Important This method has a delay when calling a channel. We recommend that you call this interface after calling the onRemoteUserOnLineNotify or maintain a remote user list yourself.
  • getUserInfo: queries remote user information.

    public abstract AliRtcRemoteUserInfo getUserInfo(String uid)                  
    Parameter description
    ParameterTypeDescription
    uidStringThe ID of the user.

    Return result

    Returns the remote user information AliRtcRemoteUserInfo.

  • isUserOnline: queries whether a user is online.

    public abstract boolean isUserOnline(String uid)
    Parameter description
    ParameterTypeDescription
    uidStringThe ID of the user.

    Return result

    true indicates online. false indicates not online.