Viewing a file in a separate app

On android it is relatively simple to view a document (pdf) from our app in another app (pdf reader) by using a JIntent and starting the activity.
I can not find a suitable way to do so on ios. I have only just noticed the iCL product, is it new? Does this have the ability to open a document with a suitable app? Could you post a small example if so please. Thank you


In iOS this is not possible without user interaction unless the other application registers a custom URL scheme that can work with your own app, for example opening a PDF. This means that by default, opening a file in another app needs user interaction via the document interaction controller.
TMS iCL has a document interaction controller available. There are demos included in the distribution.

Hi Pieter thanks for your reply. I'm not trying to do this without user interaction. I already have this code

App := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication);
URL := TNSUrl.Wrap(TNSUrl.OCClass.fileURLWithPath(NSSTR(pFileName)));
controller := TUIDocumentInteractionController.Wrap(TUIDocumentInteractionController.OCClass.interactionControllerWithURL(url));

Showing the document interaction controller, however when I click an appropriate app nothing happens. Hence why I asked whether iCL could help.

I have installed iCL now and have looked through all the demos, none of them contain a document interaction controller.

I have also looked through the docs and there is nothing helpful on the TMSFMXNativeUIDocumentInteractionController.

Looking through other topics in this forum a delegate has been mentioned but I can see no way of adding one to TMSFMXNativeUIDocumentInteractionController.

I can see a setDelegate method on on the TUIDocumentInteractionController but don't know what to set.

You should be able to execute this code:

  TMSFMXNativeUIDocumentInteractionController1.File := pFileName;