getPeerOnlineStatus method

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

@detail api @author hanchenchen.c @brief 查询对端用户或本端用户的登录状态 @param peerUserID 需要查询的用户 ID @return - 0: 调用成功。 - < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明 @note - 必须调用 login{@link #RTCEngine#login} 登录后,才能调用本接口。 - 调用本接口后,SDK 会使用 onGetPeerOnlineStatus{@link #IRTCEngineEventHandler#onGetPeerOnlineStatus} 回调通知查询结果。 - 在发送房间外消息之前,用户可以通过本接口了解对端用户是否登录,从而决定是否发送消息。也可以通过本接口查询自己查看自己的登录状态。

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}');
  }
}