setServerParams method
@detail api
@author hanchenchen.c
@brief Set application server parameters
Client side calls sendServerMessage{@link #RTCEngine#sendServerMessage} or sendServerBinaryMessage{@link #RTCEngine#sendServerBinaryMessage} Before sending a message to the application server, you must set a valid signature and application server address.
@param signature Dynamic signature. The App server may use the signature to verify the source of messages.
You need to define the signature yourself. It can be any non-empty string. It is recommended to encode information such as UID into the signature.
The signature will be sent to the address set through the "url" parameter in the form of a POST request.
@param url The address of the application server
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details
@note
- The user must call login{@link #RTCEngine#login} to log in before calling this interface.
- After calling this interface, the SDK will use onServerParamsSetResult{@link #IRTCEngineEventHandler#onServerParamsSetResult} to return the corresponding result.
Implementation
Future<int?> setServerParams(
{required string signature, required string url}) async {
$a() => ($instance as $p_a.RTCEngine).setServerParams(signature, url);
$i() => ($instance as $p_i.ByteRTCEngine).setServerParams(signature, url);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}