onRequestToken property

void Function(RtcConnection connection)? onRequestToken
final

Occurs when the token expires.

The SDK triggers this callback if the token expires. When receiving this callback, you need to generate a new token on your token server and you can renew your token through one of the following ways: In scenarios involving one channel: Call renewToken to pass in the new token. Call leaveChannel to leave the current channel and then pass in the new token when you call joinChannel to join a channel. In scenarios involving mutiple channels: Call updateChannelMediaOptionsEx to pass in the new token.

  • connection The connection information. See RtcConnection.

Implementation

final void Function(RtcConnection connection)? onRequestToken;