I have an app which has defined a document type and is able to open such files with a given extension.
This works perfectly for example with AirDrop or from Mail, but it does not work with the new Files app in iOS 11
on a real device.
It works in the simulator, there are two cases: If the URL of the file to open comes in via
- (BOOL) application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
I check if the file attributes are accessible. If so, I can use the file item directly, if not, I use
[NSFileCoordinator coordinateReadingItemAtURL:options:error:byAccessor:],
the file is downloaded from iCloud and I can process it using the new URL delivered by the result handler.
On a real device this does not work - I get an error that I am not having the access rights to access the file attributes.
If I am using the NSFileCoordinator, the result handler returns without an error, but trying to access the item at the new URL
leads to the same problem.
Does anybody have an idea what I can do to solve this?