Forum Xamarin.iOS

PresentOpenInMenu Menu opens but clicking on iBooks or anything Else Does Nothing?

rgiampietrorgiampietro USMember ✭✭
edited December 2017 in Xamarin.iOS

I'm opening a local (bundle resource) in a web-view (which is all working) and want to allow the user the option of copying the PDF to their iBooks (or any app they choose) for later use.

I have the following code which opens the 'Open-In' menu and I see iBooks and other options on a test iPad, but when I click the 'Copy to iBooks' icon (or any other choice), nothing happens other than the 'Open-In' pop-up menu is dismissed.

Do I need to add something to handle the event that actually opens it in iBooks or causes the an external app to handle the request?

Here is the code:
string localPDFUrl = Path.Combine(NSBundle.MainBundle.BundlePath, "Content/WebIZMobileHelp.pdf");
var docINteractionController = UIDocumentInteractionController.FromUrl(NSUrl.FromFilename(localPDFUrl));
docINteractionController.PresentOpenInMenu(OpenInButtonItem, true);

Update: so it actually is working for a few of the Open-In choices including 'Add to Notes' and 'Save to Files', but even after installing Adobe Acrobat for iPad it won't directly open in Acrobat (I can 'Save to Files' and place it in the Adobe Acrobat folder and then open it from Acrobat). It seems like a bug since it's working ok in some of the Open-In menu options but maybe the file path has to be constructed differently?

PS: Sorry I meant to post this as a Question; if a MOD can change it for me, please do ! Thx

Sign In or Register to comment.