updateToken abstract method

Future<int?> updateToken(
  1. String token
)

Updates Token.

You must call this API to update token to ensure the RTC call to continue when you receive RTCRoomEventHandler.onTokenWillExpire, RTCRoomEventHandler.onPublishPrivilegeTokenWillExpire, or RTCRoomEventHandler.onSubscribePrivilegeTokenWillExpire.

token: The updated Token. If the Token is invalid, you will receive RTCRoomEventHandler.onRoomStateChanged with the error code of -1010.

See ReturnStatus for return values.

Notes:

  • 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 RTCRoom.updateToken and RTCRoom.joinRoom 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 RTCRoom.joinRoom with a valid token to rejoin the room.

Implementation

Future<int?> updateToken(String token);