Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use "open in..." feature to iOS app?

Tags:

ios

iphone

ipad

I'm not looking to add my app to the "open in..." list, but to get the list itself. And sending the file to another app.

I'm working on internal communication app, so when user receive a file attachment, s/he can open the file with whatever app is installed on each devices...

like image 422
marko Avatar asked Mar 01 '12 09:03

marko


People also ask

How do I open a file with a specific app iOS?

Open a file once with a specific appSelect the file in the Finder, choose File > Open With, then choose an app. Control-click the file, choose Open With, then choose an app. Open the app, then choose File > Open.

How do I get my application to show up in the open in menu on iOS for a specific document type?

Q: How do I get my application to show up in the “Open in...” menu on iOS for a specific document type? A: You need to register the document types that your application can open with iOS. To do this you need to add a document type to your app's Info. plist for each document type that your app can open.

How do I change open with on iPhone?

Go to Settings and scroll down until you find the browser app or the email app. Tap the app, then tap Default Browser App or Default Mail App. Select a web browser or email app to set it as the default. A checkmark appears to confirm it's the default.


1 Answers

UIDocumentInteractionController *controller = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:appFile]];
        self.controller.delegate = self;
CGRect navRect = self.view.frame;
[self.controller presentOptionsMenuFromRect:navRect inView:self.view animated:YES];

Implement following UIDocumentInteractionControllerDelegate methods

#pragma mark - UIDocumentInteractionControllerDelegate

//===================================================================
- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
{
    return self;
}

- (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
{
    return self.view;
}

- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
{
    return self.view.frame;
}
like image 129
Mitul Nakum Avatar answered Sep 22 '22 12:09

Mitul Nakum