[英]How can I read documents in my app's Document directory from other iOS apps?
I have an app in which i am downloading pdf files from server and store them locally in document directory. 我有一个应用程序,我正在其中从服务器下载pdf文件,并将其本地存储在文档目录中。 Now, i want to read that files outside my app , means i want to read that files using other pdf reader applications, 现在,我想在我的应用程序之外读取这些文件,这意味着我想使用其他pdf阅读器应用程序来读取这些文件,
How can I Read those files using other apps? 如何使用其他应用程序读取这些文件?
I came across same question Here , it has good answer but it is too old. 我在这里遇到了同样的问题,它的回答很好,但是太旧了。 at that time it was not possible so is that possible right now? 当时不可能,现在可以吗?
Is it possible to save those files in iBooks? 是否可以将这些文件保存在iBooks中?
I want to make one thing clear 我想澄清一件事
"I don't want to open the app supporting pdf files, i just want to open pdf files stored within my app with other app. like we can access Photos app & get images from device like that i want to open pdf files stored within my app" “我不想打开支持pdf文件的应用程序,我只想与其他应用程序一起打开存储在我的应用程序中的pdf文件。就像我们可以访问“照片”应用程序并从设备中获取图像一样,我想打开存储在其中的pdf文件我的应用程序”
You can open file URLs with UIApplication's openURL: method. 您可以使用UIApplication的openURL:方法打开文件URL。 Because of sandboxing, other apps could not access any files within your application's Documents folder. 由于使用沙箱,其他应用程序无法访问应用程序的“文档”文件夹中的任何文件。
You need to use UIDocumentInteractionController to open documents that you download or create in other applications. 您需要使用UIDocumentInteractionController打开在其他应用程序中下载或创建的文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.