Received in application(_:open:options:) as a regular (non-security-scoped) file URI
File is already copied to app container, so can always be persistently accessed
options map contains UIApplicationOpenURLOptionsOpenInPlaceKey: false in my observation (could hypothetically have nil or the key might be absent)
Previously, I thought that with correct setup (proper keys in Info.plist), all apps would be able to "Open In", but it turns out that some, in particular Google Drive, can never "Open In" but only offer "Copy To", regardless of the target application and its capabilities.
On iOS, files can be opened from other apps in two ways:
application(_:open:options:)
as an "open in place" security-scoped resourceoptions
map containsUIApplicationOpenURLOptionsOpenInPlaceKey: true
application(_:open:options:)
as a regular (non-security-scoped) file URIoptions
map containsUIApplicationOpenURLOptionsOpenInPlaceKey: false
in my observation (could hypothetically havenil
or the key might be absent)Previously, I thought that with correct setup (proper keys in Info.plist), all apps would be able to "Open In", but it turns out that some, in particular Google Drive, can never "Open In" but only offer "Copy To", regardless of the target application and its capabilities.
file_picker_writable currently handles receiving "Copy To" files OK: it ignores the failure to obtain a security scope in
_prepareUrlForReading
: https://github.com/hpoul/file_picker_writable/blob/72470d06f366039c568cd216fb5ccc6608cb9326/ios/Classes/SwiftFilePickerWritablePlugin.swift#L188-L198But when trying to reopen a bookmark obtained from such a file, it fails due to strict checking in
readFile
: https://github.com/hpoul/file_picker_writable/blob/72470d06f366039c568cd216fb5ccc6608cb9326/ios/Classes/SwiftFilePickerWritablePlugin.swift#L104-L106