renewAgoraToken method

Future<void> renewAgoraToken(
  1. 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 {
  try {
    Map req = {"agora_token": agoraToken};
    Map result = await platform_interface.Client.instance
        .callNativeMethod(ChatMethodKeys.renewToken, req);
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}