Jump to content

ClientInfo on Mobile Form


Anuchit

Recommended Posts

on Desktop , I can check what's browser using on Event Form   OnActivate 

on Mobile no have Event OnActivate I'm try use Event OnShow , OnCreate , OnReady

but can't Show browser type and browser version ,

... what Event I can use on Mobile,  When I want to show Browser Type and Browser Version 

Link to comment
Share on other sites

1 hour ago, Sherzod said:

Sorry, what do you need that for, just for information... ?

 

I want to Check Browser  when user use my application

I want to customize them using Chorme or Safari .

 

 

if (C.BrowserType <> 'chrome') or (C.BrowserType <> 'safari')  then
  begin
    ShowMessage('Can use on Chrome or safari !!!');
  end;

Link to comment
Share on other sites

class function TSistema.GetNavegador: string;
var
  C : TUniClientInfos;
begin
  C := UniApplication.ClientInfo;

  if ciIE in C then
    Result := 'IE'
  else if ciFireFox in C then
    Result := 'FireFox'
  else if ciOpera in C then
    Result := 'Opera'
  else if ciSafari in C then
    Result := 'Safari'
  else if ciChrome in C then
    Result := 'Chrome'
  else
    Result  := 'Other';
  
  //(or and) you can use it with userAgent and add browsers according to your need ..

  if UniSession.UserAgent <> EmptyStr then
  begin
    if (Pos('chrome',LowerCase(UniSession.UserAgent))> 0) then
      Result := 'Chrome';
    if (Pos('chrome',LowerCase(UniSession.UserAgent))> 0) and (Pos('opr',LowerCase(UniSession.UserAgent))> 0) then
      Result := 'Opera';
    if (Pos('chrome',LowerCase(UniSession.UserAgent))> 0) and (Pos('edge',LowerCase(UniSession.UserAgent))> 0) then
      Result := 'Edge';
  end;
end;

 

Link to comment
Share on other sites

12 hours ago, Marlon Nardi said:

class function TSistema.GetNavegador: string;
var
  C : TUniClientInfos;
begin
  C := UniApplication.ClientInfo;

  if ciIE in C then
    Result := 'IE'
  else if ciFireFox in C then
    Result := 'FireFox'
  else if ciOpera in C then
    Result := 'Opera'
  else if ciSafari in C then
    Result := 'Safari'
  else if ciChrome in C then
    Result := 'Chrome'
  else
    Result  := 'Other';
  
  //(or and) you can use it with userAgent and add browsers according to your need ..

  if UniSession.UserAgent <> EmptyStr then
  begin
    if (Pos('chrome',LowerCase(UniSession.UserAgent))> 0) then
      Result := 'Chrome';
    if (Pos('chrome',LowerCase(UniSession.UserAgent))> 0) and (Pos('opr',LowerCase(UniSession.UserAgent))> 0) then
      Result := 'Opera';
    if (Pos('chrome',LowerCase(UniSession.UserAgent))> 0) and (Pos('edge',LowerCase(UniSession.UserAgent))> 0) then
      Result := 'Edge';
  end;
end;

 

I will try this. Thank you so much

Link to comment
Share on other sites

×
×
  • Create New...