Is it possible to write a file to the iOS filesystem with Expo so that it is accessible via the iOS 11 Files app(是否可以使用 Expo 将文件写入 iOS 文件系统,以便可以通过 iOS 11 Files 应用程序访问它)
问题描述
我目前正在使用 React Native 的 Expo 库将音频记录写入 iOS 文件系统.我正在使用 FileSystem.documentDirectory
根据 expo docs,但是在使用 iOS11 Files 应用程序时无法访问此文件.Expo是否有可能在允许这样做的地方写,或者在iCloud上写失败?FileSystem.documentDirectory
似乎是文件系统中的一个沙盒区域.
I'm currently writing an audio recording to the iOS filesystem using the Expo library for React Native. I'm using the FileSystem.documentDirectory
as per the expo docs, however this file isn't accessible when using the iOS11 Files app. Is it possible with Expo to write somewhere which allows this, or failing that to iCloud? It seems like the FileSystem.documentDirectory
is a sandboxed area within the filesystem.
推荐答案
实际上它看起来确实有效,但是您必须构建实际的 iOS 应用程序 .ipa 文件.它不能通过模拟器在 expo 中运行,但是一旦我通过 TestFlight 进行测试,文件确实会出现在 Files 应用程序中.
Actually it appears that it does work, but you have to build the actual iOS app .ipa file. It wasn't working from expo via simulator, but once I was testing via TestFlight the files did appear in the Files app.
Expo 的 app.json
的 ios
键看起来像这样.我还没有测试是否需要所有这些键:
The ios
key of Expo's app.json
looks like this. I haven't tested whether all of these keys are required:
"ios": {
"infoPlist": {
"UISupportsDocumentBrowser": true,
"UIFileSharingEnabled": true,
"LSSupportsOpeningDocumentsInPlace": true
}
}
这篇关于是否可以使用 Expo 将文件写入 iOS 文件系统,以便可以通过 iOS 11 Files 应用程序访问它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以使用 Expo 将文件写入 iOS 文件系统,以便可以通过 iOS 11 Files 应用程序访问它


基础教程推荐
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01