onTokenWillExpire method

FutureOr<void> onTokenWillExpire(
  1. ByteRTCGameRoom rtcRoom
)

@detail callback @author luomingkang @brief The callback is triggered when the SDK detects the joining room privilege from the Token will expires within 30s. After receiving this callback, you must call updateToken:{@link #ByteRTCGameRoom#updateToken} to update the joining room privilege Token. @param rtcRoom ByteRTCGameRoom instance. @note After a user's joining room privilege expires:
- When attempting to join a room, the user will receive rtcRoom:onRoomStateChangedWithReason:withUid:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onRoomStateChangedWithReason:withUid:state:reason} with the error code "-1000" indicating that the Token is invalid. - If the user is already in the room, he/she will be removed from the room and receive rtcRoom:onRoomStateChangedWithReason:withUid:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onRoomStateChangedWithReason:withUid:state:reason} with the error code "-1009" indicating that the Token is expired. Remote users in the room will receive rtcRoom:onUserLeave:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onUserLeave:reason} with the reason "2" indicating that the Token is invalid. @order 10

Implementation

FutureOr<void> onTokenWillExpire(ByteRTCGameRoom rtcRoom) async {}