renewToken method
Renews the token when the current token expires.
In the following situations, the SDK decides that the current token has expired:
- The SDK triggers the RtcChannelEventHandler.tokenPrivilegeWillExpire callback, or
- The RtcChannelEventHandler.connectionStateChanged callback reports the ConnectionChangedReason.TokenExpired error.
You should get a new token from your server and call this method to renew it. Failure to do so results in the SDK disconnecting from the Agora server.
Parameter
token
The new token.
Implementation
@override
Future<void> renewToken(String token) {
return _invokeMethod('renewToken', {'token': token});
}