fetchPreferredNotificationLanguage method

Future<String?> fetchPreferredNotificationLanguage()

Gets the preferred language for push notifications.

Return The language code.

Throws A description of the exception. See ChatError.

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;
  }
}