UIDocumentInteractionController Opening a file in a specific application without parameters

I am using UIDocumentInteractionController to open a file in another DropBox application.

What I'm trying to do is open the file in another specific application, but so far I have managed to display the supported applications and let the user 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]; 

Here is a list of supported applications, but I want to directly open the file using Dropbox without the options window. Any ideas?

+6
source share
2 answers

I would be glad if they contradicted me, but I think this is impossible (at least until iOS 4).

The usual way to open the file in another application is to use a custom URL scheme. (See Documentation for openURL: in the UIApplication Class Directory, and Implementing Custom URL Schemas in the iOS Application Programming Guide.) In my best case, Dropbox did not implement a custom URL scheme. And, given that this approach is closed.

The UIDocumentationController is pretty opaque. You can persuade him to tell you if there is any application on the device that will open your file . But it is not clear that you can do much.

+1
source

If you want to offer an open file in a specific application, just add (using swift 3.0):

 docController.uti = @"com.dropbox.ios"; 
0
source

Source: https://habr.com/ru/post/893453/


All Articles