我在firebase上有一些电子出版物。我正在使用Alamofire downloadURL函数下载特定的电子出版物,但是我需要电子出版物filePath才能通过FolioReader打开它。
我已经尝试了destinationURL.path,但不适用于FolioReader
downloadBookRef.downloadURL { (url, error) in
//Done
let destination: DownloadRequest.DownloadFileDestination = {_, _ in
let documentsURL: NSURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! as NSURL
print("documentURL", documentsURL)
let fileURL = documentsURL.appendingPathComponent("kitap\(item).epub")
print("fileURL", fileURL ?? "")
return (fileURL!, [.removePreviousFile, .createIntermediateDirectories])
}
download(url!, to: destination).response { response in
if response.error == nil, let filePath = response.destinationURL?.path {
print("filePath", filePath)
}
}
}