Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Cordova read/write files in the iOS "Files" app?

Tags:

cordova

Does anyone know if the iOS "Files" application data can be accessed via Cordova? I.e., I want to add my application to the list of "Locations" in the Files application, and then read/write those files. Is this possible?

Thanks!

like image 286
user2943799 Avatar asked Mar 27 '19 07:03

user2943799


2 Answers

You must set iCloud under Capabilities in Xcode. Don't forget to set the Container for your App Identifier.

Maybe this option will help you in future:

LSSupportsOpeningDocumentsInPlace

like image 182
hydrococcus Avatar answered Sep 22 '22 10:09

hydrococcus


I also had this issue and resolved it. Here's what I did: To give the files app access to my app's data, I had to open the info.plist file (just search for "info.plist" in your iOS platform folder) and add the following snippet:

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

Now, when you click on your Ressources > info.plist file in xcode, you should have this entry:

Screenshot Data Access

After building your app to your device, the files app should then give you access to "On My (Device)" and list all folders and files you created using the cordova file plugin.

like image 25
MarBo Avatar answered Sep 18 '22 10:09

MarBo