fetchConversationSilentMode method

Future<ChatSilentModeResult> fetchConversationSilentMode({
  1. required String conversationId,
  2. required ChatConversationType type,
})

Gets the offline push settings of a conversation.

Param conversationId The conversation ID.

Param type The conversation type.

Return The offline push settings of the conversation.

Throws A description of the exception. See ChatError.

Implementation

Future<ChatSilentModeResult> fetchConversationSilentMode({
  required String conversationId,
  required ChatConversationType type,
}) async {
  try {
    Map req = {};
    req["convId"] = conversationId;
    req["conversationType"] = type.index;
    Map result = await platform_interface.Client.instance.pushManager
        .callNativeMethod(ChatMethodKeys.fetchConversationSilentMode, req);
    ChatError.hasErrorFromResult(result);
    Map map = result[ChatMethodKeys.fetchConversationSilentMode];
    return ChatSilentModeResult.fromJson(map);
  } catch (e) {
    rethrow;
  }
}