onRoomTokenWillExpire method

void onRoomTokenWillExpire(
  1. String roomID,
  2. int remainTimeInSecond
)

Callback notification that room Token authentication is about to expire.

Available since: 2.8.0 Description: The callback notification that the room Token authentication is about to expire, please use renewToken to update the room Token authentication. Use cases: In order to prevent illegal entry into the room, it is necessary to perform authentication control on login room, push streaming, etc., to improve security. When to call /Trigger: 30 seconds before the Token expires, the SDK will call onRoomTokenWillExpire to notify developer. Restrictions: None. Caution: The token contains important information such as the user's room permissions, publish stream permissions, and effective time, please refer to https://docs.zegocloud.com/article/11649. Related APIs: When the developer receives this callback, he can use renewToken to update the token authentication information.

  • roomID Room ID where the user is logged in, a string of up to 128 bytes in length.
  • remainTimeInSecond The remaining time before the token expires.

Implementation

void onRoomTokenWillExpire(
  String roomID,
  int remainTimeInSecond,
) {}