leaveRoom method
@detail api
@brief Leave the RTS room.
The user calls this method to leave the room, end the call process, and release all call-related resources.
@return
- 0: Success. If the user is a host:
- The other participants receive onUserLeave{@link #IRTSRoomEventHandler#onUserLeave} callback.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details
@note
- After a user who calls setUserVisibility{@link #RTCRoom#setUserVisibility} to make himself visible leaves the room, other users in the room will receive a callback notification from onUserLeave{@link #IRTSRoomEventHandler#onUserLeave}.
- This method is an asynchronous operation, and the call returns without actually exiting the room. After you actually exit the room, you will receive a callback notification from onRoomStateChanged{@link #IRTSRoomEventHandler#onRoomStateChanged} locally. If the engine is destroyed immediately after this method is called, the SDK will not be able to trigger the onRoomStateChanged{@link #IRTSRoomEventHandler#onRoomStateChanged} callback.
Implementation
FutureOr<int> leaveRoom() async {
return await nativeCall('leaveRoom', []);
}