sendServerBinaryMessage method
@detail api
@author hanchenchen.c
@brief Client side sends binary messages to the application server (P2Server)
@param buffer
Binary message content sent
Message does not exceed 46KB.
@return
- > 0: sent successfully, return the number of the sent message, increment from 1.
- -1: Sent failed due to empty message.
@note
- Before sending a binary 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 that the sending succeeded or failed;
- If the binary message is sent successfully, the application server that previously called the setServerParams{@link #RTCEngine#setServerParams} setting will receive the message.
Implementation
FutureOr<long> sendServerBinaryMessage(ArrayBuffer buffer) async {
return await nativeCall('sendServerBinaryMessage', [buffer]);
}