updatePushDisplayStyle method

Future<void> updatePushDisplayStyle(
  1. DisplayStyle displayStyle
)

~english Updates the push message display style. The default value is DisplayStyle.Simple.

Param displayStyle The push message display style.

Throws A description of the issue that caused this exception. See EMError ~end

~chinese 更新推送通知的展示方式。

Param displayStyle 推送通知的展示方式。默认为 DisplayStyle.Simple

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

Implementation

Future<void> updatePushDisplayStyle(DisplayStyle displayStyle) async {
  Map req = {'pushStyle': displayStyle == DisplayStyle.Simple ? 0 : 1};
  Map result =
      await PushChannel.invokeMethod(ChatMethodKeys.updateImPushStyle, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}