Delphi 11.3 FMX.TWebBrowser loop while trying to send consent confirmation for google Maps (Android)

128 Views Asked by At

so right now i have a FMX App with a TWebBrowser set to EdgeIfAvailable and am trying to visit https://www.google.de/maps. If it's my first time visiting google maps i'm redirected to the consent page - so far so good - the problem occurs if i try to accept or decline the cookies on Android because i end up in a loop where the consent page is reloaded over and over again. Im not trying to open google maps in the Maps App btw. I want the Browser version in my TWebBrowser.

Some threads here say i could use the "shouldOverrideUrlLoading" for this problem but it's seems wrong.The following is the standard implementation

function TAndroidWebBrowserService.TWebBrowserListener.shouldOverrideUrlLoading(view: JWebView; url: JString): Boolean;
begin
  FWBService.ShouldStartLoading(JStringToString(url));
  Result := False;
end;

At the moment my only work around is:

  1. try visiting google maps
  2. accepting or declining(entering the loop)
  3. use a Button in the App that lets me navigate to another URL from google maps (with some random address)
  4. now i can enter google maps and the normal url is okay again

I guess that the work around works because the cookie is set properly and only the redirect has an error

Is there perhaps a problem with the http code 302 or 303 in Android TWebBrowser or is it the Android Web View?

Thanks for your help

0

There are 0 best solutions below