fetchConversationSilentMode method

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

~english 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 EMError. ~end

~chinese 获取指定会话的离线推送设置。

Param conversationId 会话 ID。

Param type 会话类型。

Return 会话的离线推送设置。

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

Implementation

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