sendServerBinaryMessage method
@detail api
@author hanchenchen.c
@brief Client side sends binary messages to the application server (P2Server)
@param messageStr
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, call login:uid:{@link #ByteRTCEngine#login:uid} to complete the login, then call setServerParams:url:{@link #ByteRTCEngine#setServerParams:url} Set up the application server.
- After calling this interface, you will receive an rtcEngine:onServerMessageSendResult:error:message:{@link #ByteRTCEngineDelegate#rtcEngine:onServerMessageSendResult:error:message} 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 setServerParams:url:{@link #ByteRTCEngine#setServerParams:url} will receive the message.
Implementation
FutureOr<NSInteger> sendServerBinaryMessage(NSData messageStr) async {
return await nativeCall('sendServerBinaryMessage:', [messageStr]);
}