renewAgoraToken method Null safety
- 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 {@link EMError}.
Implementation
Future<void> renewAgoraToken(String agoraToken) async {
Map req = {"agora_token": agoraToken};
Map result = await _channel.invokeMethod(ChatMethodKeys.renewToken, req);
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}