简体   繁体   中英

How to Flutter write files to iOS iPhone “Find on my phone” Folder

My goal is to allow my app user write and read files created by my app. For example, write and then allow the user to email a.CSV file of data, or a.GPX file of location data. And on the other end, import a file back into my application.

I have successfully deployed an Android version of my app (Plant List GPS) which uses Flutter plugin path_provider 1.6.10. On Android, I successfully use external directories, but this external directories solution is not available/allowed for iOS. I find on iOS I can create subfolders and write to the getApplicationDocumentsDirectory, but when I try to find/read that file from a file picker solution, it cannot be seen. I understand this is proper behavior to protect sensitive app files in this folder location.

I also understand that iOS has the concept of an app Sandbox and appreciate its objectives. I'm not trying to defeat it, but find a way to access/use it in my Flutter app. I have played around in writing test data files to various places on the iOS file system using the iPhone 11 simulator on my MacBook, but can not get any file to appear in the phone "Find on my phone" dialog.

Any help in solution approach or technique is appreciated.

I think you need to add both the keys into info.plist, and then files from your app directory will be visible on Files app! LSSupportsOpeningDocumentsInPlace UIFileSharingEnabled

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM