setConversationSilentMode method

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

Sets the push notifications for a conversation.

Param conversationId The conversation ID.

Param type The conversation type.

Param param The offline push parameters.

Throws A description of the exception. See ChatError.

Implementation

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

  Map result = await PushChannel.invokeMethod(
      ChatMethodKeys.setConversationSilentMode, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}