downloadGroupSharedFile method

Future<void> downloadGroupSharedFile({
  1. required String groupId,
  2. required String fileId,
  3. required String savePath,
})

~english Downloads the shared file of the group.

Note: The callback is only used for progress callback.

Param groupId The group ID.

Param fileId The ID of the shared file.

Param savePath The local path of the shared file.

Throws A description of the exception. See EMError. ~end

~chinese 下载指定的群组共享文件。

Param groupId 群组 ID。

Param fileId 共享文件的 ID。

Param savePath 共享文件的本地路径。

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

Implementation

Future<void> downloadGroupSharedFile({
  required String groupId,
  required String fileId,
  required String savePath,
}) async {
  Map req = {'groupId': groupId, 'fileId': fileId, 'savePath': savePath};
  Map result = await _channel.invokeMethod(
      ChatMethodKeys.downloadGroupSharedFile, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}