updateToken method
@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.
Implementation
FutureOr<int> updateToken(NSString token) async {
return await nativeCall('updateToken:', [token]);
}