updatePushDisplayStyle method

Future<void> updatePushDisplayStyle(
  1. DisplayStyle displayStyle
)

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

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

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

Implementation

Future<void> updatePushDisplayStyle(DisplayStyle displayStyle) async {
  try {
    Map req = {'pushStyle': displayStyle == DisplayStyle.Simple ? 0 : 1};
    Map result = await platform_interface.Client.instance.pushManager
        .callNativeMethod(ChatMethodKeys.updateImPushStyle, req);
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}