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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to