When dropping images from the Photos app into my custom application, at - (void)dropInteraction:(UIDropInteraction *)interaction performDrop:(id<UIDropSession>)session
I receive an NSURL*
whose [url absoluteString]
takes the following form:
file:///var/tmp/com.apple.DragUI.druid/.com.apple.DragUI.4tyFQQ/version=1&uuid=FF693BFB-99FF-4790-BBF2-A226593F718D&mode=compatible.png
Whenever I try to consume this file path, I receive a The file couldn’t be opened because there is no such file
error. This makes sense, since the path itself doesn't look normal. I've seen other implementations that suggest it's possible that these should take a more expected path format.
Just in case the read issue was associated with access permissions, I can successfully wrap the operation with:
BOOL success = [url startAccessingSecurityScopedResource] /* begin */;
// ...
if (success) {
[url stopAccessingSecurityScopedResource] /* terminate */;
}
However this doesn't impact on the response data. The application can currently also successfully read and write to the image gallery in other user journeys outside of Drag-and-Drop, so it doesn't appear to me to be related to missing permissions.
By contrast, I can handle NSConcreteData
types that are passed from Brave Browser via performDrop
without error.
Does anyone have an idea at what's happening? Is there any way that this provided URI can be normalized so that I can resolve the file correctly, or is it possibly indicative of an erroneous application state?
I'm running iOS 14 on a physical iPad.