updateToken method
@detail api
@brief Updates the room token.
You must call this API to update token to ensure the RTC call to continue when you receive onTokenWillExpire{@link #IRTCRoomEventHandler#onTokenWillExpire}, onPublishPrivilegeTokenWillExpire{@link #IRTCRoomEventHandler#onPublishPrivilegeTokenWillExpire}, or {@link #IRTCRoomEventHandler#onSubscribePrivilegeTokenWillExpire}.
@param token Valid token.
If the Token is invalid, you will receive onRoomStateChanged{@link #IRTSRoomEventHandler#onRoomStateChanged} with the error code of -1010.
@return API call result:
- 0: Success.
- <0: Failure. See ReturnStatus{@link #ReturnStatus} for specific reasons.
@note
- Do not call both updateToken{@link #RTSRoom#updateToken} and joinRTSRoom{@link #RTSRoom#joinRTSRoom} 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{@link #RTSRoom#joinRTSRoom} with a valid token to rejoin the room.
Implementation
FutureOr<int> updateToken(String token) async {
return await nativeCall('updateToken', [token]);
}