sendUserMessageOutsideRoom method

Future<int?> sendUserMessageOutsideRoom({
  1. required string uid,
  2. required string message,
  3. required MessageConfig config,
})

@detail api @author hanchenchen.c @brief 给房间外指定的用户发送文本消息(P2P) @param uid
消息接收用户的 ID @param message
发送的文本消息内容。
消息不超过 64 KB。 @param config 消息类型,参看 MessageConfig{@link #MessageConfig}。 @return - >0:发送成功,返回这次发送消息的编号,从 1 开始递增。 @note - 在发送房间外文本消息前,必须先调用 login{@link #RTCEngine#login} 完成登录。 - 用户调用本接口发送文本信息后,会收到一次 onUserMessageSendResultOutsideRoom{@link #IRTCEngineEventHandler#onUserMessageSendResultOutsideRoom} 回调,得知消息是否成功发送。 - 若文本消息发送成功,则 uid 所指定的用户会通过 onUserMessageReceivedOutsideRoom{@link #IRTCEngineEventHandler#onUserMessageReceivedOutsideRoom} 回调收到该消息。

Implementation

Future<int?> sendUserMessageOutsideRoom(
    {required string uid,
    required string message,
    required MessageConfig config}) async {
  $a() => ($instance as $p_a.RTCEngine).sendUserMessageOutsideRoom(
      uid, message, t_MessageConfig.code_to_android(config));
  $i() => ($instance as $p_i.ByteRTCEngine).sendUserMessageOutsideRoom(
      uid, message, t_MessageConfig.code_to_ios(config));

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