changeAppKey method
- required String newAppKey,
~english Updates the App Key, which is the unique identifier to access Agora Chat.
You can retrieve the new App Key from Agora Console.
As this key controls all access to Agora Chat for your app, you can only update the key when the current user is logged out.
Param newAppKey
The App Key. Ensure that you set this parameter.
Throws A description of the exception. See ChatError. ~end
~chinese 修改 App Key。
@note 只有在未登录状态才能修改 App Key。
Param newAppKey
App Key,请确保设置该参数。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError。 ~end
Implementation
Future<bool> changeAppKey({required String newAppKey}) async {
EMLog.v('changeAppKey: $newAppKey');
Map req = {'appKey': newAppKey};
Map result =
await ClientChannel.invokeMethod(ChatMethodKeys.changeAppKey, req);
try {
ChatError.hasErrorFromResult(result);
return result.boolValue(ChatMethodKeys.changeAppKey);
} on ChatError catch (e) {
throw e;
}
}