sendUserMessageOutsideRoom method
- required string uid,
- required string message,
- required MessageConfig config,
@detail api
@author hanchenchen.c
@brief Send a text message (P2P) to a specified user outside the room
@param uid User ID of the message receiver
@param message
Text message content sent.
Message does not exceed 64 KB.
@param config Message type, see MessageConfig{@link #MessageConfig}.
@return
- > 0: Sent successfully, return the number of the sent message, increment from 1.
@note
- Before sending an out-of-room text message, you must call login{@link #RTCEngine#login} to login.
- After the user calls this interface to send a text message, he will receive an onUserMessageSendResultOutsideRoom{@link #IRTCEngineEventHandler#onUserMessageSendResultOutsideRoom} callback to know whether the message was successfully sent.
- If the text message is sent successfully, the user specified by uid receives the message via the onUserMessageReceivedOutsideRoom{@link #IRTCEngineEventHandler#onUserMessageReceivedOutsideRoom} callback.
Implementation
Future<int?> sendUserMessageOutsideRoom(
{required string uid,
required string message,
required MessageConfig config}) async {
$a() => ($instance as $p_a.RTCEngine).sendUserMessageOutsideRoom(
uid, message, t_MessageConfig.code_to_android(config));
$i() => ($instance as $p_i.ByteRTCEngine).sendUserMessageOutsideRoom(
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}');
}
}