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