sendUserMessageOutsideRoom method

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

@detail api @author hanchenchen.c @brief Sends a text message (P2P) to a specified user outside the room @param userId
Message Receives the user's ID @param messageStr
Text message content sent
Message does not exceed 64 KB. @param config Message type, see ByteRTCMessageConfig{@link #ByteRTCMessageConfig}. @return - > 0: Sent successfully, return the number of the sent message, increment from 1. @note - Before sending an out-of-room text message, you should call login:uid:{@link #ByteRTCEngine#login:uid} to complete login. - After the user calls this interface to send a text message, he will receive an rtcEngine:onUserMessageSendResultOutsideRoom:error:{@link #ByteRTCEngineDelegate#rtcEngine:onUserMessageSendResultOutsideRoom:error} callback to know whether the message was sent successfully; - If the text message is sent successfully, the user specified by the userId will receive the message through rtcEngine:onUserMessageReceivedOutsideRoom:message:{@link #ByteRTCEngineDelegate#rtcEngine:onUserMessageReceivedOutsideRoom:message} callback.

Implementation

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