简体   繁体   English

如何 Flutter 将文件写入 iOS iPhone“在我的手机上查找”文件夹

[英]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.例如,写入然后允许用户到 email 一个.CSV 文件的数据,或者一个.GPX 文件的位置数据。 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.我已经成功部署了我的应用程序(植物列表 GPS)的 Android 版本,它使用 Flutter 插件 path_provider 1.6.10。 On Android, I successfully use external directories, but this external directories solution is not available/allowed for iOS.在 Android 上,我成功使用了外部目录,但是对于 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.我在 iOS 上找到我可以创建子文件夹并写入 getApplicationDocumentsDirectory,但是当我尝试从文件选择器解决方案中查找/读取该文件时,它看不到。 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.我也了解 iOS 具有应用程序沙盒的概念并欣赏其目标。 I'm not trying to defeat it, but find a way to access/use it in my Flutter app.我不是想打败它,而是想办法在我的 Flutter 应用程序中访问/使用它。 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.我曾在我的 MacBook 上使用 iPhone 11 模拟器将测试数据文件写入 iOS 文件系统上的各个位置,但无法让任何文件出现在手机“在我的手机上查找”对话框中。

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!我认为您需要将两个密钥都添加到 info.plist 中,然后您的应用程序目录中的文件将在 Files 应用程序上可见! LSSupportsOpeningDocumentsInPlace UIFileSharingEnabled LSSupportsOpeningDocumentsInPlace UIFileSharingEnabled

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在iPhone模拟器文件夹下找到我的应用程序文件? - How can I find my app files under iPhone Simulator folder? 在我的 iPhone 文件夹上,如何为我的应用创建文件夹? [iOS 13] - On My iPhone folders, how to create a folder for my app? [iOS 13] iOS Swift,“在我的iPhone上”文件夹的网址是什么 - iOS Swift, what is the url of the “on my iPhone” folder 如何在我的应用程序中播放来自iOS / iPhone的内部声音文件? - How to play internal sound files from iOS/iPhone in my app? 如何在iPhone的Documents文件夹中找到文件的文件名? - How do I find filenames of files in my iPhones Documents folder? 是否存在“查找我的iPhone”的iOS配置配置文件密钥? - Is there a iOS Configuration Profile Key for “Find My iPhone?” 如何找到iOS模拟器文件夹 - How to find the iOS simulator folder 如何从 Flutter 中的 URL 下载文件并将它们保存在 iOS 共享文件夹中? - How to download files from URL in Flutter and save them in iOS shared Folder? 如何在我的 iPhone 上安装 Flutter 版本 iOS 应用程序? - How do I get a Flutter release iOS app onto my iPhone? 如何从 Flutter 生成 iOS 版本,以便我的客户可以在他们的 iPhone 设备上测试应用程序? - How to generate iOS build from Flutter so my client can test the app in their iPhone device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM