iOS Code Snippet Make your app files accessible with Files app

ilan

Expert
Licensed User
Longtime User
B4X:
#PlistExtra: <key>LSSupportsOpeningDocumentsInPlace</key><true/><key>UIFileSharingEnabled</key><true/>

All files in File.DirDocuments will be accessible from the Files app (and iTunes as well).

thank you very much erel this is a great feature. do we need to create a folder? or is a folder automatically created with the app name?
if someone add a file to that shared folder can we then read it from file.DirDocuments in our app?
 

mcqueccu

Well-Known Member
Licensed User
Longtime User
No need to create the folder. I haven't tested whether the folder appears in Files app when it is empty.

The Folder appeared in the Files App with the application label as the Name.
I created new folder with the Name B4X in directory documents like below

B4X:
File.MakeDir(File.DirDocuments,"B4X")

And I can see it in application label/B4X

Thank you Erel for this
 

OlavRossland

Member
Licensed User
Longtime User
B4X:
#PlistExtra: <key>LSSupportsOpeningDocumentsInPlace</key><true/><key>UIFileSharingEnabled</key><true/>

All files in File.DirDocuments will be accessible from the Files app (and iTunes as well).
This make my app crash - also if I start a complete new and clean app.
 

OlavRossland

Member
Licensed User
Longtime User
I've tested it on iOS 16. I see a debugging issue that occurs from time to time where the app crashes on startup but does work if you manually start it.
It doesn't happen in release mode.
Try it.
I tried as you said - and it worked.
 
Top