renewAgoraToken method
- String agoraToken
Renews the Agora token.
If a user is logged in with an Agora token, when the token expires, you need to call this method to update the token.
Param agoraToken
The new Agora token.
Throws A description of the exception. See ChatError.
Implementation
Future<void> renewAgoraToken(String agoraToken) async {
Map req = {"agora_token": agoraToken};
Map result =
await ClientChannel.invokeMethod(ChatMethodKeys.renewToken, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}