fetchPreferredNotificationLanguage method

Future<String?> fetchPreferredNotificationLanguage()

获取用户设置的推送翻译语言。

Return 设置的语言代码。

Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 EMError

Implementation

Future<String?> fetchPreferredNotificationLanguage() async {
  Map result = await PushChannel.invokeMethod(
    ChatMethodKeys.fetchPreferredNotificationLanguage,
  );
  try {
    EMError.hasErrorFromResult(result);
    String? ret = result[ChatMethodKeys.fetchPreferredNotificationLanguage];
    return ret;
  } on EMError catch (e) {
    throw e;
  }
}