User agent detection problem...

yonk
15 years, 1 month ago
Hi, i installed the latest version (0.9.1) of mobilejoomla, and the problem is that my iPod touch isnt properly detected, so the site it is shown as the standard version. These are my specs:

- iPod Touch 1G firmware 3.0 (jailbreak done)
- User agent of the iPod (got from web server): Mozilla/5.0 (device; U; CPU iPhone OS 3_0 like Mac OS X; es-es) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16

The key issue is that where appears 'device' should appear 'iPod', and that's what confuse the User Agent detection of mobilejoomla. However, the same device is properly detected by JA Purity II template o another site, which integrates an iPhone version in the template, so it would be great if the user agent detection could be modified to fix this issue.

Thanks.
mrmacadamia
15 years, 1 month ago
Well, I don't have iphone/ipod around to test, but I tested from this site(emulator), www.testiphone.com/ ,
my site show normal page. I had to set "Global Setting"->"User Agent Checking" = "Always Iphone/Ipod" to make it working which I don't want.I want to focus on to other mobile phone as well.
Barkley
15 years, 1 month ago
Having the same problem... iphone is not detected but all other pda / smartphones seem to work correctly.
yonk
15 years ago
This bug is still unfixed in version 0.9.3. It would be great if developers could take a look at it, it must be very easy to fix.

Thx
dryabov
15 years ago
yonk, support of iPod Touch 1G firmware 3.0 will be included into version 0.9.4.

To add support to v0.9.3, replace line 143 in plugins/system/mobilebot.php to
[php] $iphone_list=array('Mozilla/5.0 (iPod;','Mozilla/5.0 (iPod touch;','Mozilla/5.0 (iPhone;','Apple iPhone ','Mozilla/5.0 (iPhone Simulator;','Mozilla/5.0 (Aspen Simulator;','Mozilla/5.0 (device; U; CPU iPhone OS');[/php]
yonk
15 years ago
Thank you dryabov, now it works. However, i wonder if it would be better to only look for "iPhone" or "iPod Touch" string in the user agent string instead of the whole 'Mozilla/5.0 (<x>;' variants.
dryabov
15 years ago
yonk wrote:
However, i wonder if it would be better to only look for "iPhone" or "iPod Touch" string in the user agent string instead of the whole 'Mozilla/5.0 (<x>;' variants.


It may lead to mistakes for phones with user agent strings like "DummiPhone" or "This phone is not iPhone" (of course, most likely there are no such a phones, so it's just an example).
Barkley
15 years ago
I tried the above change (thanks for adding this) however it still doesn't work for my site. I tried various online emulators. Do you have either an online emulator or application that you test with?
yonk
15 years ago
Barkley wrote:
I tried the above change (thanks for adding this) however it still doesn't work for my site. I tried various online emulators. Do you have either an online emulator or application that you test with?

Mozilla Firefox + User Agent Switcher plugin
Barkley
15 years ago
That worked! Thanks very much ....
1

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.