onTokenPrivilegeWillExpire property

void Function(RtcConnection connection, String token)? onTokenPrivilegeWillExpire
final

Occurs when the token expires in 30 seconds. When the token is about to expire in 30 seconds, the SDK triggers this callback to remind the app to renew the token.Upon receiving this callback, generate a new token on your server, and call renewToken to pass the new token to the SDK.

  • connection The connection information. See RtcConnection .
  • token The token that expires in 30 seconds.

Implementation

final void Function(RtcConnection connection, String token)?
    onTokenPrivilegeWillExpire;