• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
iOS open In place, permission denied
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iOS open In place, permission denied


  • Subject: iOS open In place, permission denied
  • From: Markus Spoettl via Cocoa-dev <email@hidden>
  • Date: Tue, 28 Apr 2020 11:23:30 +0200

Hi everyone,

  I have a strange problem with the

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options

app delegate method, that seems to have cropped up a couple of weeks ago when switching to the iOS 13 SDK (from 12). My app can no longer access files that are sent to it via "Open In".

My app declares the relevant UTIs and sets

UIFileSharingEnabled
LSSupportsOpeningDocumentsInPlace

in the Info.pList. The App delegate receives the message above just fine, but accessing the given URL yields the following error (when using "Open In" from the Files.app):

Error Domain=NSCocoaErrorDomain Code=257 "The file “foo.bar couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/372CF62C-2C92-446A-9A7E-0CA3884388A2/File Provider Storage/foo.bar, NSUnderlyingError=0x281ce7120 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

I've tried copying the file (it is a local file) via NSFileManager -copyItemAtURL::: as well reading its contents via NSData -dataWithContentsOfURL::: both produce this permission error.

This worked fine prior to switching to Xcode 11 and the iOS SDK 13, I'm sure I'm just missing a tiny bit that is now required.

Thanks for any pointers!

Best Regards
Markus

--
__________________________________________
Markus Spoettl
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: iOS open In place, permission denied
      • From: Markus Spoettl via Cocoa-dev <email@hidden>
  • Prev by Date: Re: Check if there are autosaved documents
  • Next by Date: Re: iOS open In place, permission denied
  • Previous by thread: Re: Check if there are autosaved documents
  • Next by thread: Re: iOS open In place, permission denied
  • Index(es):
    • Date
    • Thread