I save a pdf on local like this :
func saveMandatPdf(pdfBase64 : String, idMandat : String) -> Bool{
guard
var documentsURL = (FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)).last,
let convertedData = Data(base64Encoded: pdfBase64, options: .ignoreUnknownCharacters)
else {
return false
}
let fileName = "\(idMandat).pdf"
documentsURL.appendPathComponent(fileName)
do {
try convertedData.write(to: documentsURL, options: .atomic)
return true
} catch {
print(error)
return false
}
}.
i checked that i can see the pdf with webview, so everything work the file is saved i can see it on seimulator tmp folder
but on a real device when i check on the application "books" i can't find this pdf files
thank you for your help