sendServerMessage method
@detail api
@author hanchenchen.c
@brief The client side sends a text message to the application server (P2Server)
@param message
The content of the text message sent
The message does not exceed 64 KB.
@return
- > 0: Sent successfully, return the number of the sent message, increment from 1.
@note
- Before sending a text message to the application server, you must first call login{@link #RTCEngine#login} to complete the login, and then call setServerParams{@link #RTCEngine#setServerParams} Set up the application server.
- After calling this interface, you will receive an onServerMessageSendResult{@link #IRTCEngineEventHandler#onServerMessageSendResult} callback to inform the message sender whether the message was sent successfully.
- If the text message is sent successfully, the application server that previously called the setServerParams{@link #RTCEngine#setServerParams} setting will receive the message.
Implementation
Future<int?> sendServerMessage(string message) async {
$a() => ($instance as $p_a.RTCEngine).sendServerMessage(message);
$i() => ($instance as $p_i.ByteRTCEngine).sendServerMessage(message);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}