UIDocumentInteractionController Opening file in a specific app without options
Asked Answered
V

1

6

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?

Vermeil answered 24/7, 2011 at 15:36 Comment(0)
L
1

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.

Landlordism answered 24/7, 2011 at 18:3 Comment(2)
And if we're talking about instagram? it has the instagram:// scheme but i don't know of any normal way to pass an image there.Vermeil
Has iOS 5 perhaps added anything for us? I can't find anything, but thought I'd ask in case someone has!!Sycee

© 2022 - 2024 — McMap. All rights reserved.