In my application, all files are saved in app's sandbox documents: ~/Documents.
How can I let users to pick file from ~/Documents using UI like Document Picker which using for picking file from iCloud or external sources?
Here is good library to create custom file picker which pointed to application sandbox (Document directory).
Below is good library to create custom file picker which pointed to application sandbox (Document directory)
https://github.com/marmelroy/FileBrowser
Related
I want to write one or multiple mov/mp4 files to iOS Files App but can not find how to do it with UIDocumentInteractionController. Looking for a sample code to copy files to a subfolder of my app in iOS files app using UIDocumentInteractionController. See sample screenshot to understand what I want.
You will first need to create a File Provider extension for your app if you are storing the files remotely.
If they are only being stored locally on device you can achieve this by (in the Info.plist) either setting the UISupportsDocumentBrowser key, or by setting bother the UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace keys.
As explained in this documentation:
These keys enable other apps to open and edit the contents of your Documents directory in place. Your files also appear in both the Files app and the document browser. For more information, see the UIDocumentBrowserViewController class.
I understand that if I provide the UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace keys in Info.plist for my iOS app, files in my app's Documents folder are shown in Files.app ("On This iPad") and the documents browser.
Now my question - aside from writing a File Provider extension - is there any way to add an app group's folder or replace the Documents folder with a folder in the app group's folder?
For sharing between my extensions, I save everything in the App Group folder instead of Documents, but then, of course, Files.app doesn't have access to those files, that's why I'm asking.
I tried creating symbolic links from the documents folder to the actual file, and they are shown, but don't work correctly ("file doesn't exist").
I've also created a File Provider extension, but it was rejected by Apple because my extension isn't cloud-backed and was only for local files. According to my reviewer, a File Provider extension must be cloud-storage backed.
Thank you for your help and insights,
-Matt
It's pretty simple: No. :(
We are struggling with the same issue and its simple: You can't participate in the files app (or iTunes File Sharing) if you don't store your files in the Documents folder.
It seems like this is not well thought out. You should not integrate as a file provider unless you are actually providing a file system such as dropbox, at least that's what we've been told at WWDC. On the other side you should support stuff like iMessage extensions, today extensions,... which only are possible if your files are accessible through an app group. But this then automatically breaks the use of the Files.app as well as iTunes Filesharing.
We filed radars for that, any duplicate would help, I guess.
Is there a way in Titanium Appcelerator to read/write file in downloads folder or shared documents folder.
As per appcelerator documentation: http://docs.appcelerator.com/platform/latest/#!/guide/Filesystem_Access_and_Storage
Ti.Filesystem.applicationDataDirectory can only accessible by app itself.
I add file in app's Document folder using
var f = Ti.Filesystem.getFile(timelogsData,'timelogs.txt');f.write(data);
then try to access by iExplorer and other file manager but no luck. I could only read it by my app only.
As per Apple documentation: https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW28 app's documents folder data can be shared.
My objective is that, my app need internet access if internet is not available then it will save data into a file that end user can send me manually or by email.
Thanks in advance.
Right now, the PDFs I download on my app are being stored in the app's document directory and can be retrieved only within the app. Is there any way to store the PDF files in the common documents directory that can be accessed by other apps?
If not, is there a way of storing my downloaded PDFs in other apps' documents directory (let's say iBooks), so that it will always be stored in iBooks.
If there are any ways, please elaborate.
There is no "commun documents directory" on iOS, each App is launched in is own sandbox and cannot access the files from other app directly.
I suggest you to check the iOS File System Basics guide from Apple in order to understand better what's happening behind the scenes.
You can still use an UIActivityController in your code to perform an export of your pdf file to iBooks or any app accepting this kind of file, but it requires some user interaction.
I need to select the file which is downloaded through mail. That text document need to be loaded into my app.
Is there any chance to do?
Apps on iOS are sandboxed, so they can not access any files outside of there own sandbox.
There is no user accessible file system thus you can not select a file that is downloaded through mail.
There is the option to allow your app to open files, by extension. You register your to, for example open txt files. Then when you have a txt file in your mail you wil be prompt that you can open the file in your app.
You can find all you need in this Apple document: Registering the File Types Your App Supports
Only if declare that your application can handle that document type then the user will get the chance to open the file with your app When they select from the mail app. This will call delegate method from you app where you can do with the file as you wish.
First you need to declare to the iOS system that your application can handle that file type.
you do this by adding by adding key:values to your applications-info.plist
This guide is what you need to follow
http://mobiforge.com/design-development/importing-exporting-documents-ios
scroll down to the part
Importing Documents