sendUserBinaryMessageOutsideRoom method

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

@detail api @author hanchenchen.c @brief Send binary messages (P2P) to the specified user outside the room @param uid User ID of the message receiver @param buffer
Binary message content sent
Message does not exceed 46KB. @param config Message type, see MessageConfig{@link #MessageConfig}. @return - > 0: sent successfully, return the number of the sent message, increment from 1. - -1: Sent failed due to empty message. @note - Before sending out-of-room binary messages, you should call login{@link #RTCEngine#login} first. - After the user calls this interface to send a binary message, he will receive an onUserMessageSendResultOutsideRoom{@link #IRTCEngineEventHandler#onUserMessageSendResultOutsideRoom} callback to notify whether the message was sent successfully; - If the binary message is sent successfully, the user specified by uid will receive the message through the onUserBinaryMessageReceivedOutsideRoom{@link #IRTCEngineEventHandler#onUserBinaryMessageReceivedOutsideRoom} callback.

Implementation

Future<int?> sendUserBinaryMessageOutsideRoom(
    {required string uid,
    required ArrayBuffer message,
    required MessageConfig config}) async {
  $a() => ($instance as $p_a.RTCEngine).sendUserBinaryMessageOutsideRoom(
      uid, message, t_MessageConfig.code_to_android(config));
  $i() => ($instance as $p_i.ByteRTCEngine).sendUserBinaryMessageOutsideRoom(
      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}');
  }
}