Can't see my app folder under iOS "Files" app on iPad but only on iPhone

6k Views Asked by At

I am trying to implement a feature where users can define their own documents using the "Files" app of iOS. I read that in order for your app to get access to the Files app you need to define these two keys in your info.plist

    <key>UIFileSharingEnabled</key>
    <true/>
    <key>LSSupportsOpeningDocumentsInPlace</key>
    <true/>

I defined those two keys but when I run my app and write to a document directory,

FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)

I dont see any Folder created with my written file inside the Files app. Interestingly, If I run the same app on my iPhone, I see the folder of my app inside the Files app immediately. I am not sure what could make the sharing only happen on iPhone and not iPad. My iPhone is running iOs 13.3 and my iPad is running 13.3.1 so not much of a difference here. Does anyone have any clue as what could be wrong?

1

There are 1 best solutions below

2
On

I have two iPads, both showing documents folders of my apps (a family of calculator simulations.) The apps were installed under iOS 13.3 or before. One of the iPads got updated to 13.3.1. I added one more app to both iPads. It promptly showed up in Files on the 13.3. device, but never on 13.3.1. Deleting the app, resetting the iPad, reinstalling - no luck. Looks definitely like an issue introduced with 13.3.1.

Update:
I finally figured out what's going on. Since the problem didn't disappear with iOS 13.4, I did some more digging. As a result, here's how to make everything working:

  1. Create an app, say "MyApp", making sure "Application supports iTunes file sharing" and "Supports opening documents in place" are enabled.
  2. In Files, "Locations", click "On My iPad".
  3. You won't see any folder called "MyApp", because it would be empty.
  4. Go to a location holding a file you want to make available to MyApp, for example iCloud Drive.
  5. Long-press the file, then select Move (not Copy!).
  6. In the list popping up, you should see MyApp.
  7. Select it, then tap the button in the top-right corner, now called Copy (not Move).
  8. Go to "On My iPad" again, and you'll see MyApp's folder, complete with the copied file!
  9. If you now delete the file, the MyApp folder will be empty again and disappear.