Welcome Guest, Not a member yet? Register   Sign In
Better User Agent for Code Igniter ?
#1

[eluser]ReyPM[/eluser]
Hi:
Does any knows if exists any better User Agent class for CI? I'm using the shipped with CI but if I navigate trough a BB device or a Android, I get always "Safari" as result. This is my code:

Code:
$this->load->library('user_agent');
          if ($this->agent->is_browser()) {
               $device = $this->agent->browser();
          } elseif ($this->agent->is_mobile()) {
               $device = $this->agent->mobile();
          } else {
               $device = "";
          }

Any help?
#2

[eluser]CroNiX[/eluser]
Much has changed with this since v2 was released 2 years ago in the github repo.
#3

[eluser]ReyPM[/eluser]
And where I can found does changes?
#4

[eluser]CroNiX[/eluser]
You should probably download the whole package as the changes to that class might rely on other changes elsewhere. First though, you could try just getting the user agent definitions and replace it in your current version.
https://github.com/EllisLab/CodeIgniter/...agents.php
#5

[eluser]ReyPM[/eluser]
Not works, test both first change the content of config/user_agents.php and then change the complete library and still saying send trough Safari when I send from my BB and of course using the browser at my BB but I test from Android ang get the same result
#6

[eluser]CroNiX[/eluser]
Then you'll probably have to figure out the proper entries to add to user_agents.php to detect android. Could also be just your particular device and not all "android" platforms. Maybe something changed your user agent string? Did you look at your agent string?
#7

[eluser]WanWizard[/eluser]
Go to http://user-agent-string.info (and click on "analyze my UA") to see exactly what your browser reports...
#8

[eluser]ReyPM[/eluser]
[quote author="WanWizard" date="1336684079"]Go to http://browsers.garykeith.com (and click on "your browser") to see exactly what your browser reports...[/quote]

Jejeje none is reported just a
Quote:403.8 Tools Abuse Detected
is showed
#9

[eluser]WanWizard[/eluser]
Updated the link to a better tool...
#10

[eluser]CroNiX[/eluser]
echo $_SERVER['HTTP_USER_AGENT'];




Theme © iAndrew 2016 - Forum software by © MyBB