ByteRTCRTSRoom class

Inheritance
  • Object
  • NativeClass
  • ByteRTCRTSRoom

Constructors

ByteRTCRTSRoom([NativeClassOptions? options])

Properties

$resource → NativeResource
no setterinherited
delegateRts FutureOr<ByteRTCRTSRoomDelegate?>
@detail callback
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
ready Future<void>
Whether the instance is initialized
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() FutureOr<void>
@detail api @brief Leaves and destroy the RTS room instance created by calling createRTSRoom:{@link #ByteRTCEngine#createRTSRoom}.
override
joinRTSRoom(NSString token, ByteRTCUserInfo userInfo) FutureOr<int>
@detail api @brief Joins an RTS room.
After creating a room by calling createRTSRoom:{@link #ByteRTCEngine#createRTSRoom}, call this API to join the room and make audio & video calls with other users in the room. @param token Dynamic key for authentication and verification of users entering the room.
You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. See Authentication with Token for token validity and generation method.
Apps with different AppIDs are not interoperable.
Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail. @param userInfo User information. See ByteRTCUserInfo{@link #ByteRTCUserInfo}. @return Method call result.
- 0: Success. - Local users receive notifications of the room state via rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo}. - -1: Invalid parameter - -2: Already in the room. After the interface call is successful, as long as the return value of 0 is received and leaveRoom{@link #ByteRTCRoom#leaveRoom} is not called successfully, this return value will be triggered when the room entry interface is called again, regardless of whether the filled room ID and user ID are duplicated. The reason for the failure will be communicated via the rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} callback. @note - In the same room with the same AppID, the user ID of each user must be unique. If two users have the same user ID, the user who joined the room later will kick the user who joined the room first out of the room, and the user who joined the room first will receive rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} callback notification, the error type is duplicate login ByteRTCErrorCodeDuplicateLogin. - Local users will receive rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} callback notification after calling this method to join the room successfully. If the local user is also a visible user, the remote user will receive an rtsRoom:onUserJoined:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserJoined} callback notification when joining the room. - After the user successfully joins the room, the SDK may lose connection to the server in case of poor local network conditions. At this time rtcEngine:onConnectionStateChanged:{@link #ByteRTCEngineDelegate#rtcEngine:onConnectionStateChanged} callback will be triggered and the SDK will automatically retry until it successfully reconnects to the server. After successful reconnection, you will receive a callback notification from rtsRoom:onUserJoined:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserJoined} locally.
leaveRoom() FutureOr<int>
@detail api @brief Leave RTC room.
The user calls this method to leave the room, ending real-time message communication and releasing all communication-related resources.
@return
+ 0: Success
+ < 0: Failure
@note
+ When a visible user leaves the room, others in the room will receive rtsRoom:onUserLeave:reason:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserLeave:reason}.
+ 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 rtsRoom:OnLeaveRoom:{@link #ByteRTCRTSRoomDelegate#rtsRoom:OnLeaveRoom} locally.
+ If the engine is destroyed immediately after this method is called, the SDK will not be able to trigger the rtsRoom:OnLeaveRoom:{@link #ByteRTCRTSRoomDelegate#rtsRoom:OnLeaveRoom} callback.
nativeCall<T>(String method, [List? args, NativeMethodMeta? meta]) Future<T>
Call instance method
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendInstanceGet<T>(String property) Future<T>
Get instance property
inherited
sendInstancePropertiesGet(dynamic nativeClass) Future<Map<String, dynamic>>
Get instance properties
inherited
sendInstanceSet(String property, dynamic value) Future<void>
Set instance property
inherited
sendRoomBinaryMessage(NSData message) FutureOr<int64_t>
@detail api @brief Sends binary messages to all other users in the room. @param message
The binary broadcast message sent by the user
The message does not exceed 46KB. @return The number of the message sent this time is incremented from 1. @note
+ Before broadcasting binary messages in the room, you must call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to join the room.
+ After calling this function, you will receive an rtsRoom:onRoomMessageSendResult:error:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomMessageSendResult:error} callback to notify the sender of the success or failure of the message;
+ If the binary message is successfully sent, all users in the room will receive rtsRoom:onRoomBinaryMessageReceived:message:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomBinaryMessageReceived:message} callback.
sendRoomMessage(NSString message) FutureOr<int64_t>
@detail api @brief Send text messages to all other users in the room. @param message
The content of the text message sent.
Message does not exceed 62KB. @return The number of the message sent this time is incremented from 1. @note
+ Before sending an in-room text message, you must call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to join the room.
+ After calling this function, you will receive an rtsRoom:onRoomMessageSendResult:error:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomMessageSendResult:error} callback to notify the sender of the success or failure of the message;
+ If the text message is sent successfully, all remote users in the room will receive rtsRoom:onRoomMessageReceived:message:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomMessageReceived:message} callback.
sendUserBinaryMessage(NSString uid, NSData message, ByteRTCMessageConfig config) FutureOr<int64_t>
@detail The api @brief Sends a binary message (P2P) to the specified user in the room. @param uid
Message Receiving user's ID @param message
Binary message content sent
Message does not exceed 46KB. @param config See ByteRTCMessageConfig{@link #ByteRTCMessageConfig}. @return The number of the message sent this time is incremented from 1. @note - Before sending the in-room binary message, you must call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to join the room. - After calling this function, you will receive an rtsRoom:onUserMessageSendResult:error:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageSendResult:error} callback to notify the sender of the success or failure of the message; - If the binary message is sent successfully, the user specified by uid will receive rtsRoom:onUserBinaryMessageReceived:message:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserBinaryMessageReceived:message} callback.
sendUserMessage(NSString userId, NSString message, ByteRTCMessageConfig config) FutureOr<int64_t>
@detail api @brief Sends a text message (P2P) to the specified user in the room. @param userId ID of the user receiving the message @param message Message content of which the length must not exceed 64 KB. @param config Reliability of the message. @return The number of the message sent this time is incremented from 1. @note - Before sending an in-room text message, you must call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to join the room. - After calling this API, you will receive an rtsRoom:onUserMessageSendResult:error:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageSendResult:error} callback to notify the sender of the success or failure of the message. - If the text message is sent successfully, the user specified by uid will receive an rtsRoom:onUserMessageReceived:message:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageReceived:message} callback.
setRTCRoomDelegateRts(id<ByteRTCRTSRoomDelegate> roomDelegate) FutureOr<int>
@detail api @brief By setting ByteRTCRTSRoomDelegate{@link #ByteRTCRTSRoomDelegate}, you can get infromed of events realted to this ByteRTCRTSRoom object. @param roomDelegate Refer to ByteRTCRTSRoomDelegate{@link #ByteRTCRTSRoomDelegate}. @return
+ 0: Success. + < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
toString() String
A string representation of this object.
inherited
updateResource(NativeResource resource) → void
inherited
updateToken(NSString token) FutureOr<int>
@detail api @brief Update Token.
You must call this API to update token to ensure the RTC call to continue when you receive onTokenWillExpire:{@link #ByteRTCRoomDelegate#onTokenWillExpire}, onPublishPrivilegeTokenWillExpire:{@link #ByteRTCRoomDelegate#onPublishPrivilegeTokenWillExpire}, or onSubscribePrivilegeTokenWillExpire:{@link #ByteRTCRoomDelegate#onSubscribePrivilegeTokenWillExpire}. @param token Valid token.
If the Token is invalid, you will receive rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} with the error code of -1010. @return - 0: Success - !0: Failure @note - In versions before 3.50, the publish and subscribe privileges contained in the Token are reserved parameters with no actual control permissions. In version 3.50 and later, the publish/subscribe privileges will be effective for whitelisted users. Please contact the technical support team to include you in the whitelist if you need this function. - Do not call both updateToken:{@link #ByteRTCRTSRoom#updateToken} and joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to update the Token. If you fail to join the room or have been removed from the room due to an expired or invalid Token, call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} with a valid token to rejoin the room.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

codegen_$namespace → dynamic
no setter