I am using this code below (in AppDelegate) to successfully open/receive a single file when the file in question has my app's custom extension and is tapped from the Files App.
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
let sharedItem = FileItem()
sharedItem.path = url
sharedItem.name = url.lastPathComponent
sharedItem.image = self.loadUIImage(fileURL: url)
let pickFilesViewController = self.window?.rootViewController as? FirstViewController
pickFilesViewController?.selectedFiles.append(sharedItem)
pickFilesViewController?.filesTableView.reloadData()
return true
}
Now when I select multiple and similar files from within the Files app and tap the share button, my app appears under the app options with the text "copy to myapp". However, when I tap it, on my app's end I only receive the first one (appended)
How I can receive all of the selected files?
This Question has some suggestions but they don't work as it appears the path all the files are sent to isn't always the inbox folder depending on a number of factors i am yet to determine.
I've determined that opening email attachments successfully send the files to the inbox folder. But it seems selecting and thus sending multiple from the Files App send to an entirely different folder.
When I've tried to open that containing folder of the first selected/sent item so that i iterate through and get the rest.... I get the error stating my app didn't have permission to access that folder
Again, is there anyway to get all the files at once? Thanks.