Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIDocumentInteractionController Opening file in a specific app without options

I'm using UIDocumentInteractionController to open a file in another app, DropBox.

What i'm trying to do is open the file in another specific app , but i only managed so far to display the supported apps and allowing the user to choose.

UIDocumentInteractionController *udi = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath: jpgPath]];
[udi retain];
CGRect r = CGRectMake(0, 0, 300, 300);
[udi presentOpenInMenuFromRect:r inView:self.view animated:YES];

This presents a list of apps supported, but i want to directly open the file with dropbox, without the options box. Any ideas?

like image 783
Shai Mishali Avatar asked Jul 24 '11 15:07

Shai Mishali


1 Answers

I'd be delighted to be contradicted, but I think this is not possible (at least up to and including iOS 4).

The normal way to open a file in another application is to use a Custom URL scheme. (See the documentation for openURL: in the UIApplication Class Reference and also Implementing Custom URL Schemes in the iOS Application Programming Guide.) To the best of my knowledge, Dropbox have not implemented a Custom URL Scheme. And, given that, this approach is closed.

UIDocumentationController is pretty opaque. You can coax it into telling you whether or not there is any application on the device that will open your file. But it's not clear you can do much else.

like image 100
Obliquely Avatar answered Oct 04 '22 20:10

Obliquely