setRoomExtraInfo method
@valid since 3.52
@detail api
@author lichangfeng.rtc
@brief Sets extra information about the RTC room the local user joins.
@param key Key of the extra information, less than 10 bytes in length.
A maximum of 5 keys can exist in the same room, beyond which the first key will be replaced.
@param value Content of the extra information, less than 128 bytes in length.
@return API call result:
- 0: Success with a taskId returned.
- <0: Failure. See SetRoomExtraInfoResult{@link #SetRoomExtraInfoResult} for the reasons.
@note
- Call joinRoom{@link #RTCRoom#joinRoom} first before you call this API to set extra information.
- After calling this API, you will receive onSetRoomExtraInfoResult{@link #IRTCRoomEventHandler#onSetRoomExtraInfoResult} callback informing you the result of the setting.
- After the extra information is successfully set, other users in the same room will receive the information through onRoomExtraInfoUpdate{@link #IRTCRoomEventHandler#onRoomExtraInfoUpdate} callback.
- Users who join the room later will be notified of all extra information in the room set prior to entering.
Implementation
Future<int?> setRoomExtraInfo(
{required string key, required string value}) async {
$a() => ($instance as $p_a.RTCRoom).setRoomExtraInfo(key, value);
$i() => ($instance as $p_i.ByteRTCRoom).setRoomExtraInfo(key, value);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}