getPeerOnlineStatus method

Future<int?> getPeerOnlineStatus(
  1. string peerUserID
)

@detail api @author hanchenchen.c @brief Query the login status of the opposite or local user @param peerUserID The user ID to be queried @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details @note - You must call login{@link #RTCEngine#login} to log in before calling this interface. - After calling this interface, the SDK notifies the query result using the onGetPeerOnlineStatus{@link #IRTCEngineEventHandler#onGetPeerOnlineStatus} callback. - Before sending an out-of-room message, the user can know whether the peer user is logged in through this interface to decide whether to send a message. You can also check your login status through this interface.

Implementation

Future<int?> getPeerOnlineStatus(string peerUserID) async {
  $a() => ($instance as $p_a.RTCEngine).getPeerOnlineStatus(peerUserID);
  $i() => ($instance as $p_i.ByteRTCEngine).getPeerOnlineStatus(peerUserID);

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}