Selecting "On My iPhone" folder in Files

I have an iOS app that allows user to select a folder (from local Files).

User is seemingly capable selecting the "On My iPhone" folder (the "Open" button is enabled, clickable and when it is tapped the app gets the relevant URL) although there's nothing in that folder apart from ".trash" item. Is selecting that folder not supported? If not why is the "Open" button enabled on that level to begin with?

nothing in that folder apart from ".trash" item

Clarification - what I meant to say: there are lots of items in that folder, just the app doesn't see anything but a single ".trash" item.

Filed a radar: FB19995978

How are you trying to access the URL? In what delegate method? Normally when you get a URL to a file outside your sandbox, the URL is only valid until the delegate method returns. Post some relevant code and clarify what APIs you are using.

Please see the code attached here..

Normally when you get a URL to a file outside your sandbox, the URL is only valid until the delegate method returns

That's not what I experience using the test app - it merely remembers the url in a variable and immediately returns from the delegate method, at some later point you could tap "start access" and afterwards "read" or "make bookmark", etc. this machinery itself works correctly.

If I were to guess: iOS doesn't want us to have an access to all app's documents (e.g. for privacy)... It's just having a possibility to select that root level makes things confusing.

Selecting "On My iPhone" folder in Files
 
 
Q