sendUserMessage method

FutureOr<long> sendUserMessage(
  1. String userId,
  2. String messageStr,
  3. MessageConfig config
)

@detail api @brief Send a point-to-point text message to the specified user in the room @param userId User ID of the message receiver @param messageStr Text message content sent. Message does not exceed 64 KB. @param config See MessageConfig{@link #MessageConfig}. @return - > 0: Sent successfully, return the number of the sent message, increment from 1 - -1: Sent failed, RTCRoom instance not created - -2: Sent failed, uid is empty @note - Before sending an in-room text message, you must call joinRTSRoom{@link #RTSRoom#joinRTSRoom} to join the room. - After the call, you will receive an onUserMessageSendResult{@link #IRTSRoomEventHandler#onUserMessageSendResult} callback to notify that the message was sent successfully or failed; - If the message was sent successfully, the user specified by the userId will receive an onUserMessageReceived{@link #IRTSRoomEventHandler#onUserMessageReceived} callback.

Implementation

FutureOr<long> sendUserMessage(
    String userId, String messageStr, MessageConfig config) async {
  return await nativeCall(
      'sendUserMessage', [userId, messageStr, config.$value]);
}