Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

C++BuilderCode SnippetDelphiFiremonkeyIOS

Learn How To Open A Delphi FireMonkey App With A Custom URL Scheme On IOS

It is surprisingly easy to launch your FireMonkey app on IOS from another app and pass it some basic settings. I have tested this solution on a recent IPad and IOS 11.4. This functionality is provided by Apple and you can easily modify your Delphi FireMonkey app to register it’s own URL Scheme and handle the incoming settings. The first thing you need to do is edit your info.plist.TemplateiOS.xml file in your project directory. Under the <%ExtraInfoPListKeys%> line you should add the following:

Be sure to replace the myappurlschemename with the actual name of your app or at least the name of the scheme you want to register and use to launch your app. It gets used to launch the app in a URL like this: myappurlschemename://mypage?myname=myvalue You can paste myappurlschemename://mypage?myname=myvalue into Safari to test launching your app. There is also a good tutorial here for XCode so you can see how it works from the XCode side.

Next up you need to add some code to your app to handle the TApplicationEvent.OpenURL event. You can do this with the following code. You will want to add FMX.Platform to your uses section and you will want to start listening to the FMXApplicationEventService in your TMainForm.OnCreate event:

When the event executes and your app is launched the LaunchURL string will get filled with the URL that the app was launched using. You can then parse the LaunchURL string to get the various parameters out of it. You’ll need IdURI and IdGlobal in your uses section for the below code. Here is the sample code to parse the URL:

Check out the Delphi 10.2 Tokyo documentation for TApplicationEvent.OpenURL which shows you the other properties of TiOSOpenApplicationContext.



Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes


Ryzen 9 5950x: One Billion Lines Of Delphi Code Compiled In ~5 Minutes On 16 Cores


DelphiCon 2020 FireMonkey Sessions Available Starting November 19


Powerful Commercial Gorilla3D Framework Upgraded For Delphi FireMonkey On Windows And Android

Sign up for our Newsletter and
stay informed

Leave a Reply