I should add that I tried using CanOpenUrl, but it kept returning false.

On 27 Apr 2012, at 11:41, MilkyJoe wrote:

> I'm using the PresentOpenInMenu functionality, to open supported documents in
> associated apps. For example, when viewing a PDF document in a UIWebView,
> iBooks is available via a "Open In..." menu, where iBook is installed.
> 
> However, I only want the "Open In..." menu to be available where one or more
> external apps, that are able to open the document, are available.
> 
> I currently have this, and it works, but is there a better way (or can this
> be cleaned up at all?):
> 
> *             private bool CanOpenIn(NSUrl url)
>               {
>                       bool canOpen = false;
>                       
>                       controller = UIDocumentInteractionController.FromUrl 
> (url);
>                       controller.Delegate = new
> UIDocumentInteractionControllerDelegateClass(this);
>                       
>                       InvokeOnMainThread(delegate{
>                       canOpen = controller.PresentOpenInMenu(new 
> RectangleF(0, 0, 0, 0),
> this.View, false);
>                               controller.DismissMenu (false);
>                               controller.Dispose ();
>                               controller = null;
>                       });
>                       
>                       return canOpen;
>               }*
> 
> Thanks
> 
> --
> View this message in context: 
> http://monotouch.2284126.n4.nabble.com/How-best-to-determine-if-an-app-is-available-to-open-a-document-such-as-iBooks-for-PDFs-tp4592328p4592328.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch


_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to