Programmatically obtain a list of installed applications that support this type of file

Although it’s obvious that we cannot get a list of installed applications on iOS, are there any tricks that allow us to determine the list of applications registered for this type of file? That is, the list that the user sees in the "Open in ..." menu for this particular file type. canOpenURL returns only a boolean, but ideally returns a list of supported installed applications.

+5
source share
3 answers

I doubt that any of your two questions (“determine the list of applications for a given file type” or “how to implement“ open in ... ”) is possible in current versions of iOS, since users do not see individual files on the home screens that display applications. Also, the application cannot "open a separate application with this particular file" (which can easily be done on Macintosh with Apple Events).

, Apple http://bugreporter.apple.com ( , Apple). ( " ..." ), Apple iOS .

+2

, , UIDocumentInteractionController UIDocumentInteractionController:

//Following in header file:
UIDocumentInteractionController *docInteractionController;

:

<UIDocumentInteractionControllerDelegate>

.m:

//Here the url is the document URL that you want to open (or you want to apply open in functionality)
self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url];
self.docInteractionController.delegate = self;

Open In :

- (void) openIn: (id) sender {
    [self.docInteractionController presentOptionsMenuFromBarButtonItem:sender animated:YES];
}

:

[self.docInteractionController dismissMenuAnimated:YES];

. URL- , .

+6

You can see this sample program. It can help you. He used an instance of the UIDocumentaInteractionController class with its UTI property (unique type identifier). This helps in restoring the list of installed applications on your phone that support the type of file that you opened in your application. You may need to rewrite the UTI property a little out of your confidence.

http://developer.apple.com/library/ios/#samplecode/DocInteraction/Introduction/Intro.html

-1
source

All Articles