fileImporter modifier: Problem to get a positive App Store Connect Feedback

I have written an App with a fileIpmorter modifier. I used TestFlight to pass it to friend for a test.

The App works fine until my friend uses the fileImporter function: He can select the file to import (simple csv file), the fileImporter closes without having read out the csv file! I was able to analyze that the do-catch-block within the fileImporter modifier throws an error at the mac of my friend.

The App behaves totally different to my Mac: On my Mac it works perfectly: the csv file is read out and the data can be used within the APP. Why does it behave like this?

Why does this happen to the mac of my friend but not on mine?

More strange: The Apple team is not able to even use the csv-file I passed them in the App Store Connect process: They are not able to select the file in the downloads folder.

All three used MAC´s with three different behaviors? - How comes?

I recommend that you try isolating this code into a small test project. I’ve attached a starting point below. If you put this into a project, build it, and send it to your friend, does it work?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"


struct ContentView: View {
    @State var status: String = "Click the Import button."
    @State var isPresented: Bool = false
    var body: some View {
        VStack {
            Text(self.status)
            Button("Import") {
                self.isPresented = true
            }
        }
        .fileImporter(isPresented: $isPresented, allowedContentTypes: [.text]) { result in
            guard case .success(let url) = result else { return }
            let didStart = url.startAccessingSecurityScopedResource()
            defer {
                if didStart {
                    url.stopAccessingSecurityScopedResource()
                }
            }
            do {
                let content = try Data(contentsOf: url)
                status = "Read \(content.count) bytes."
            } catch {
                status = "Read failed."
            }
        }
        .padding()
    }
}
fileImporter modifier: Problem to get a positive App Store Connect Feedback
 
 
Q