sendUserMessage method

FutureOr<int64_t> sendUserMessage(
  1. NSString userId,
  2. NSString message,
  3. ByteRTCMessageConfig config
)

@detail api @brief Sends a text message (P2P) to the specified user in the room. @param userId ID of the user receiving the message @param message Message content of which the length must not exceed 64 KB. @param config Reliability of the message. @return The number of the message sent this time is incremented from 1. @note - Before sending an in-room text message, you must call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to join the room. - After calling this API, you will receive an rtsRoom:onUserMessageSendResult:error:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageSendResult:error} callback to notify the sender of the success or failure of the message. - If the text message is sent successfully, the user specified by uid will receive an rtsRoom:onUserMessageReceived:message:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageReceived:message} callback.

Implementation

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