fileImporter doesn't do anything on another user's device

Hello,

I'm seeing a strange error on another user's device where the SwiftUI file importer doesn't do anything at all. When selecting multiple files and hitting "open", the importer just freezes. Here's a video showing the problem: https://streamable.com/u5grgy

I'm unable to replicate on my own device, so I'm not sure what could be going on. I have startAccessingSecurityScopedResource and stopAccessingSecurityResource everywhere I access a file from fileImporter as well.

here is the code in question, just in case:

            .fileImporter(
                isPresented: $showDialog,
                allowedContentTypes: [ndsType!],
                allowsMultipleSelection: true
            ) { result in
                do {
                    let urls = try result.get()
                    for url in urls {

                        if url.startAccessingSecurityScopedResource() {
                            ... // process the file here
                        } else {
                            showErrorMessage = true
                            break
                        }
                    }    
                } catch {
                    showErrorMessage = true
                    print(error)
                }      
            }  

@groovywitch a few things:

  • The video isn't available in the url.

  • Have you requested the appropriate Read/Write file access ? Access files with standard user interactions covers this.

  • Could you provide the steps and the actions you have taken to investigate the issue ?

fileImporter doesn't do anything on another user's device
 
 
Q