App doesn't have permission to open files

Here's how my app used to work:

  1. On one device, generate a text file with a custom extension.
  2. Send it via AirDrop or in Messages to another device.
  3. Open the file in another copy of my app.
  4. The app processes the data correctly the way I want.

Now, when I try to do this, I get this:

Error Domain=NSCocoaErrorDomain Code=257 "The file “Shopping List.sld” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/Downloads/Shopping List.sld, NSUnderlyingError=0x282280a50 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Downloads/Shopping%20List.sld

I think this broke with the iOS 17 upgrade.

What permissions or capabilities do I need to add to my app to do that, and how do I go about adding them? I am quite new to xCode and iOS developement, but I had this working before.

Replies

I think this broke with the iOS 17 upgrade.

That makes it sound like this issue.

Share and Enjoy

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