sendUserBinaryMessage method
Future<int?>
sendUserBinaryMessage({
- required string userId,
- required ArrayBuffer buffer,
- required MessageConfig config,
@detail api @brief Sends a point-to-point binary message to the specified user in the room. @param userId Message Receives user ID @param buffer Binary message content sent. Message does not exceed 46KB. @param config See MessageConfig{@link #MessageConfig} @note - Before sending in-room binary messages, 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 onUserBinaryMessageReceived{@link #IRTSRoomEventHandler#onUserBinaryMessageReceived} callback.
Implementation
Future<int?> sendUserBinaryMessage(
{required string userId,
required ArrayBuffer buffer,
required MessageConfig config}) async {
$a() => ($instance as $p_a.RTCRoom).sendUserBinaryMessage(
userId, buffer, t_MessageConfig.code_to_android(config));
$i() => ($instance as $p_i.ByteRTCRoom).sendUserBinaryMessage(
userId, buffer, 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}');
}
}