Google drive showing custom UTI files dimmed in UIDocumentBrowserViewController controller - ios

We have created custom UTI of the file type in XML format for our iOS app. It is working fine for all other cloud service provider except for google drive. We are using UIDocumentBrowserViewController and defined our custom UTI in the app.plist file. Still, Google drive shows our application files as dimmed, as the user is unable to select the file stored in the drive. We can open the file if we provide public.xml as UTI in app.plist. But We don't want to open any XML format in our app, as we have customized XML tag for our app. Any help /point to get it solved would be highly appreciated. Thank you in advance.

Related

How to Save video file to iOS Files App using UIDocumentInteractionController

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.

import .doc and .pdf for my App

I am developing an application that consists of the annotation registry.
In the form, I want the user to add files like .doc .jpg or .pdf
My question is about importing pdf and doc. Where can I import them into my app?
Can I get files from DropBox, Google Drive or iCloud?
Is there somewhere on the iPhone where my files get saved and I can get them to add to my app?
I think UIDocumentPickerViewController is a proper tool for that.

How to show file picker which pointed to application sandbox in ios?

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

Google Drive & iOS8 UIDocumentPickerViewController - file grayed out

I'm using iOS8 UIDocumentPickerViewController to export and import a zip file to different cloud services (iCloud,DropBox,Drive, etc.).
I don't have issues with iCloud and Dropbox, but with Google Drive I can't import the file because it is grayed out in the interface that displays files (export is working like a charm).
The funny thing is that if I upload a zip file to Drive via the Web interface, the file is not grayed out and I can import it via UIDocumentPickerViewController - so I suspect this is an issue during the export that create the issue when I want to import the zip file.
Notes:
The exported zip file can of course be downloaded via Google drive web interface.
I tried to use a proprietary extensions (instead of .zip) defined it the info.plist, but it is the same result (works everywhere except when importing from Drive)
I thought the issue was with the UTI passed to UIDocumentPickerViewController but I tried all kind of UTI (kUTTypeZipArchive, #"public.archive", #"public.zip-archive") with no success (in both case: with a proprietary extension, or with a .zip extension)
I also export/import XML files (with a proprietary extension) and everything is working well for all cloud services including Drive - I just had to add the "public.data" UTI in the allowed UTIs in UIDocumentPickerViewController.
This seems to be a bug in Google Drive. It does not handle the allowedUTIs correctly.
I also wanted to open my own proprietary types, but they didn't work. I had to add "public.data" to allow all files and check the extension when a document was picked. This is not as nice as if only my types were available in the picker, but it works.

is there any way to select downloaded file from file explorer in IOS?

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

Resources