Cordova可以在iOS的“文件"中读取/写入文件吗?应用程序? [英] Can Cordova read/write files in the iOS "Files" app?

查看:252
本文介绍了Cordova可以在iOS的“文件"中读取/写入文件吗?应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道是否可以通过Cordova访问iOS文件"应用程序数据吗?即,我想将我的应用程序添加到文件"应用程序的位置"列表中,然后读取/写入这些文件.这可能吗?

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?

谢谢!

推荐答案

我也遇到了此问题,并已解决.这是我所做的: 要授予文件应用访问我的应用数据的权限,我必须打开info.plist文件(只需在您的iOS平台文件夹中搜索"info.plist")并添加以下代码段:

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/>

现在,当您单击xcode中的Ressources> info.plist文件时,您应该具有以下条目:

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

截图数据访问

在将应用程序构建到设备上之后,文件应用程序应使您能够访问在我(设备)上"并列出使用cordova文件插件创建的所有文件夹和文件.

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.

这篇关于Cordova可以在iOS的“文件"中读取/写入文件吗?应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆