Jump to content
uniGUI Discussion Forums
Sign in to follow this  
Anuchit

ClientInfo on Mobile Form

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 

Share this post


Link to post
Share on other sites

Hi,

1 hour ago, Anuchit said:

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

First of all, what code do you use to detect browser type and version ?

Share this post


Link to post
Share on other sites
54 minutes ago, Sherzod said:

Hi,

First of all, what code do you use to detect browser type and version ?

Thank you for Reply.

Untitled11.png

Share this post


Link to post
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;

Share this post


Link to post
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;

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

×