setConversationSilentMode method

Future<void> setConversationSilentMode({
  1. required String conversationId,
  2. required ChatConversationType type,
  3. required ChatSilentModeParam param,
})

设置指定会话的离线推送设置。

Param conversationId 会话 ID.

Param type 会话类型.

Param param 离线推送参数.

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

Implementation

Future<void> setConversationSilentMode({
  required String conversationId,
  required ChatConversationType type,
  required ChatSilentModeParam param,
}) async {
  try {
    Map req = {};
    req["convId"] = conversationId;
    req["conversationType"] = type.index;
    req["param"] = param.toJson();

    Map result = await platform_interface.Client.instance.pushManager
        .callNativeMethod(ChatMethodKeys.setConversationSilentMode, req);
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}