I am using Delphi 10
In older RAD Studio Versions for iOS it was possible to use openURL
with SharedApplication in Apple.Utils.pas
But Apple.Utils.pas
cannot be found, in what unit can I find SharedApplication
and openURL
?
You can find SharedApplication
and openURL
in iOSapi.UIKit
, you will also need iOSapi.foundation, Macapi.Helpers
And to use it, you will need a SharedApplication
Object and a NSURL
object that contains the address you would like to navigate to
uses iOSapi.UIKit,iOSapi.foundation, Macapi.Helpers
var
App : UIApplication;
url : NSurl;
begin
App := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication);
url := TNSURL.Wrap(TNSURL.OCClass.URLWithString(StrToNSStr('http://www.stackoverflow.com')));
if App.canopenURL(url) then //Check if there is a default App that can open the URL
App.openURL(url) else
ShowMessage('Can not open URL');
end;