Open my local file with another registered apps

Hi
I try the new property
"Files property to support different kinds of file types in TTMSFMXNativeUIActivityViewController"
but it I can open a dialog with a compatible app for .doc, .zio, .pdf ecc. files.
Can I propose a compatible app with TTMSFMXNativeUIActivityViewController?

If not can you try the "TUIDocumentInteractionController" class?

I find only one sample that doesn't  work:
procedure TForm2.fileOpenIn(fpath: string);
var
  controller : UIDocumentInteractionController;
  URL: NSURL;
begin
  URL := TNSUrl.Wrap(TNSUrl.OCClass.URLWithString(NSSTR(fpath)));
  controller := TUIDocumentInteractionController.Alloc;
  controller.setURL(URL);
  controller.presentOpenInMenuFromRect(
      WindowHandleToPlatform(self.Handle).View.frame,
      WindowHandleToPlatform(self.Handle).View,
      true
    );
end;

tanks for support

There is an option to specify other kinds of actions, such as additional apps that handle opening doc, pdf, etc.. but we haven't investigated that open for the UIActivityViewController. We will add this on our feature request list. For the UIDocumentInteractionController, the URL needs to be a fileURL and the document controller has a class function that returns an instance based on an URL. The code could be changed to:


var
  controller : UIDocumentInteractionController;
  URL: NSURL;
begin
  URL := TNSUrl.Wrap(TNSUrl.OCClass.fileURLWithPath(NSSTR(fpath)));
  controller := TUIDocumentInteractionController.Wrap(TUIDocumentInteractionController.OCClass.interactionControllerWithURL(url));
  controller.presentOpenInMenuFromRect(
      WindowHandleToPlatform(self.Handle).View.frame,
      WindowHandleToPlatform(self.Handle).View,
      true
    );

Hi Pieter.


I tried your example but the app closes immediately without the possibility of debugging. 
I tried also to use a TMSFMXNativeUIActivityViewController1 as the target and for a few milliseconds I see a list IOS apps but then closes immediately. 
Can you try the attached example?  -->   http://www.miodiario.com/doc/dic.zip

thanks

Following this example, specifying the delegate, we are able to display the contents of a PDF file in a preview:


http://www.g8production.com/post/54417573525/open-with-in-ios-uidocumentinteractioncontroller

Kind Regards, 
Pieter

Are you able to display a PDF in a frimonley app using "uidocumentinteractioncontroller" or using xcode?

Can you share a delphi sample?
thanks

We have unfortunately little time to investigate all of this, but if you search for the UIDocumentInteractionControllerDelegate in the iOSApi.UIKit unit, you will see that it is commented.

You can copy the code, create a TOCLocal class based on a sample in one of the TMS iCL controls and assign the delegate to the UIDocumentController following the sample at the URL http://www.g8production.com/post/54417573525/open-with-in-ios-uidocumentinteractioncontroller when converting it to Delphi code. The only events that needs to be uncommented are the three events that are specified in the sample.

Kind Regards, 
Pieter

Hello Pieter

I'm so sorry for asking for your help in this thread.

I've registered WebGMaps and Pack suites for Firemonkey, I'm developing with Delphi XE 6 my mobile applications.

I do Android and iOS apps, I'm planning to buy the iCL too but right now I'm having troubles to upload apps to the App Store.

Apparentely Embarcadero release a fix 

ID: 30022Beta Hotfix for Submitting iOS Applications to Apple App Store


Is there possible you can share to me the patch so I can upload my existing iOS apps and buy you the iCL suite too?

Here's the Embarcadero download link

http://cc.embarcadero.com/Item/30022

Regards
Alejandro

You can download this fix directly from the Embarcadero website. Not sure why you need a patch from us as it is Embarcadero that provides it?

Kind Regards, 

Pieter