fetchPreferredNotificationLanguage method
~english Gets the preferred language for push notifications.
Return The language code.
Throws A description of the exception. See ChatError. ~end
~chinese 获取用户设置的推送翻译语言。
Return 设置的语言代码。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。 ~end
Implementation
Future<String?> fetchPreferredNotificationLanguage() async {
Map result = await PushChannel.invokeMethod(
ChatMethodKeys.fetchPreferredNotificationLanguage,
);
try {
ChatError.hasErrorFromResult(result);
String? ret = result[ChatMethodKeys.fetchPreferredNotificationLanguage];
return ret;
} on ChatError catch (e) {
throw e;
}
}