delphi - Opening URL within ios application -
i need open webpage safari in ios application.
xe2 there iphoneall unit, exposed uiapplication. xe4 doesn't use fpc anymore, can't use that.
embarcadero documentation says can use sdks c++ or using delphi interfaces (and still, macapi osx only, not ios). so, seems there no interface uikit framework?!
solution tried was:
_system('open http://www.google.com'); but had no affect @ all!
there other ways open urls or out of luck accomplish it?
know there twebbrowser component ios, wouldn't want take road display webpage.
thanks in advance!
by chance, @ embarcadero posted code snippet this 2 days ago.
if using xe4, in samples, , can find 1 (sorry, not sure of name) final code is:
openurl('http://www.embarcadero.com'); this uses xe4 firemonkey framework , class helper written david clegg, available in sample.
if using older version of firemonkey, can use rather more cumbersome code:
function sharedapplication: uiapplication; begin result := tuiapplication.wrap(tuiapplication.occlass.sharedapplication); end; procedure tform2.button1click(sender: tobject); begin sharedapplication.openurl(tnsurl.wrap(tnsurl.occlass.urlwithstring(nsstr(pchar(string('http://www.embarcadero.com')))))); end; (attribution: code snippets copied linked blog post.)
there very old forum post days of firemonkey showing how tackle these problems in general (basically, string <-> nsstring <-> nsurl), , while it's bit out of date - can see above code, firemonkey has matured - may give insight underlying reason code.
Comments
Post a Comment