sendUserBinaryMessageOutsideRoom method

FutureOr<NSInteger> sendUserBinaryMessageOutsideRoom(
  1. NSString userId,
  2. NSData messageStr,
  3. ByteRTCMessageConfig config
)

@detail api @author hanchenchen.c @brief Send binary messages (P2P) to the specified user outside the room @param userId
Message receiving user's ID @param messageStr
Binary message content sent
Message does not exceed 46KB. @param config Message type, see ByteRTCMessageConfig{@link #ByteRTCMessageConfig}. @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 must call login:uid:{@link #ByteRTCEngine#login:uid} to complete login. - After the user calls this interface to send a binary message, he will receive an rtcEngine:onUserMessageSendResultOutsideRoom:error:{@link #ByteRTCEngineDelegate#rtcEngine:onUserMessageSendResultOutsideRoom:error} callback to notify whether the message was sent successfully; - If the binary message is sent successfully, the user specified by the userId will use rtcEngine:onUserBinaryMessageReceivedOutsideRoom:message:{@link #ByteRTCEngineDelegate#rtcEngine:onUserBinaryMessageReceivedOutsideRoom:message} callback Receive the message.

Implementation

FutureOr<NSInteger> sendUserBinaryMessageOutsideRoom(
    NSString userId, NSData messageStr, ByteRTCMessageConfig config) async {
  return await nativeCall('sendUserBinaryMessageOutsideRoom:message:config:',
      [userId, messageStr, config.$value]);
}