Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting Mobile browser and orientation
#4
Something is not working... Always defines as stationary. Look, I probably wrote something wrong...

ServerController:

  public
    { Public declarations }
    mMobile : Boolean;
  end;
...
procedure TIWServerController.IWServerControllerBaseBrowserCheck(
  aSession: TIWApplication; var rBrowser: TBrowser);
begin
  if rBrowser.IsMobile
  then mMobile := true
  else mMobile := false;
end;

procedure TfmVmMain.IWAppFormShow(Sender: TObject);
var
begin
  if TIWServerController(WebApplication).mMobile then
  begin
    lblbUser.Caption := 'Mobile';
  end else begin
    lblbUser.Caption := 'Stationary';
  end;
end;

Always defines as Stationary
Reply


Messages In This Thread
RE: Detecting Mobile browser and orientation - by Сергей Александрович - 05-21-2021, 05:55 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)