Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Registering Delphi app to handle file type on iOS

I found this article on how to associate an xCode iOS app with a file type / extension:

Email Tutorial for iOS: How To Import and Export App Data Via Email in your iOS App

Which says:

other app wants to send your app a file, it does so via one of two methods: via application:didFinishLaunchingWithOptions, passing the URL in the UIApplicationLaunchOptionsURLKey, or via application:handleOpenURL.

Will Delphi be able to do the above as well? It has been a long time since I last used Delphi for mobile, but I am contemplating buying it again. I just want to make sure there are no showstoppers to stop me from doing things like this.

I have found this which might indicate that it is possible with recent versions of Delphi although not 100% sure:

  • http://qc.embarcadero.com/wc/qcmain.aspx?d=115594

And someone else "hacking" units in an earlier version (close to the same problem)

  • http://codeverge.com/embarcadero.delphi.ios/can-a-firemonkey-app-s-appdelegate-res/1989168
like image 568
Tom Avatar asked Dec 06 '25 06:12

Tom


1 Answers

You can definitely do it with Delphi. The more interesting question is if FMX supports it so it is ready to use without patching FMX.

FMX/XE8 implements application:openURL:sourceApplication:annotation:. When this is called, FMX will send a TApplicationEvent.OpenURL application event with TiOSOpenApplicationContext as context using the TMessageManager. You can subscribe to that message.

I don't see any file url handling in application:didFinishLaunchingWithOptions. You'd have to patch FMX.Platform.iOS for that.

like image 79
Sebastian Z Avatar answered Dec 08 '25 18:12

Sebastian Z



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!