ios - programmatically set file visibility on iOS (LSSupportsOpeningDocumentsInPlace)
问题描述
I would like to control at runtime whether or not my app's files should be visible to users in the Files app (based upon some app-internal permissions logic).
As far as I'm aware, this functionality can be set in an app's read-only Info.plist at design-time via the following two keys, and is shipped as part of the app bundle:
- UIFileSharingEnabled
- LSSupportsOpeningDocumentsInPlace
I've tried setting these values as false ("YES") in the Info.plist, and then overriding them at runtime with:
NSUserDefaults.StandardUserDefaults.SetBool(
true,
"UIFileSharingEnabled");
NSUserDefaults.StandardUserDefaults.SetBool(
true,
"LSSupportsOpeningDocumentsInPlace");
The values are updated correctly in NSUserDefaults, but it doesn't have any effect on whether or not the app's files are visible in the Files app.
Although I'm on Xamarin I'd still welcome swift/objectiveC answers.
解决方案
推荐阅读
- terraform - 如何通过openstack中的terraform将多个卷动态附加到多个实例?
- pandas - 如何计算列表元素并制作表格?
- c++ - 图像 OpenCV C++ 中的对数失真
- python - 为视频分类调整训练数据时出错
- java - 有没有更好的方法来为操纵杆输入做很多 if else 语句
- c# - EWS 连接给出未经授权的 (401) 错误
- javascript - 选择下拉菜单未更新散景图(使用 CustomJS)
- git - Git 分支高效工作流程
- c++ - 无法让 QSettings 正确写入我的设置
- react-native - 如何在本机反应中使用来自axios post的数组