onTokenWillExpire method
@detail callback
@author luomingkang
@brief 当 SDK 检测到 Token 的进房权限将在 30 秒内过期时,触发该回调。
收到该回调后,你需调用 updateToken:{@link #ByteRTCGameRoom#updateToken} 更新 Token 进房权限。
@param rtcRoom ByteRTCGameRoom 实例
@note 若 Token 进房权限过期且未及时更新:
- 用户此时尝试进房会收到 rtcRoom:onRoomStateChangedWithReason:withUid:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onRoomStateChangedWithReason:withUid:state:reason} 回调,提示错误码为 -1000 Token 无效;
- 用户已在房间内则会被移出房间,本地用户会收到 rtcRoom:onRoomStateChangedWithReason:withUid:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onRoomStateChangedWithReason:withUid:state:reason} 回调,提示错误码为 -1009 Token 过期,同时远端用户会收到 rtcRoom:onUserLeave:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onUserLeave:reason} 回调,提示原因为 1 Token 进房权限过期。
Implementation
FutureOr<void> onTokenWillExpire(ByteRTCGameRoom rtcRoom) async {}