downloadVoiceFile method

Future<Map> downloadVoiceFile(
  1. {required dynamic target,
  2. required String? messageId}
)

下载语音 target 聊天对象, JMSingle | JMGroup | JMChatRoom messageId 本地数据库中的消息 id,非 serverMessageId

Implementation

Future<Map> downloadVoiceFile({
  required dynamic target,
  required String? messageId,
}) async {
  Map param = target.toJson();
  param['messageId'] = messageId;
  Map resJson = await _channel.invokeMethod(
      'downloadVoiceFile', param..removeWhere((key, value) => value == null));

  return {'messageId': resJson['messageId'], 'filePath': resJson['filePath']};
}