modolabs / Kurogo-Mobile-Web

Kurogo is a PHP framework for delivering high quality, data driven customizable content to a wide range of mobile devices. Its strengths lie in the customizable system that allows you to adapt content from a variety of sources and easily present that to mobile devices from feature phones, to early generation smart phones, to modern devices and tablets
http://kurogo.org
GNU Lesser General Public License v2.1
198 stars 99 forks source link

iPad Device Detection #16

Closed conover closed 13 years ago

conover commented 13 years ago

External device detection reports the iPad (version 1) as pagetype Webkit with platform iphone. Is that by design? I would think it would return pagetype tablet with platform ipad.

Further, even if device detection reported the iPad as having pagetype tablet with platform ipad, lines 63-71 of DeviceClassifier.php seem to set it back to pagetype compliant with platform iphone.

I'm working on a tablet representation of our mobile site and I've been having to force force the device to get it to set pagetype to tablet.

I'll see what device detection returns with an iPad 2 tomorrow.

Thanks for looking into the issue.

arkonan commented 13 years ago

The DeviceClassifier should only map iPads and Android tablets to compliant devices if the site variable TABLET_ENABLED is set to 0 (line 60). This setting exists for sites which do not want to provide a tablet-specific interface. If TABLET_ENABLED is not set or set to 1, the DeviceClassifier should not change the tablet pagetype.

conover commented 13 years ago

I see your point about the check on line 60 of DeviceClassifier.php, I missed the exclamation point there.

Before that logic though, the JSON returned from the service in the detectDeviceExternal method for both the iPad and iPad 2 is:

supports_certificate = True pagetype = Webkit description = iPad platform = iphone

I guess the long and short of it is that the tablet templates and styles are never displayed even when TABLET_ENABLED is set to 1.

arkonan commented 13 years ago

Which device detection system are you using?

You can check this by looking at the site.ini variable MOBI_SERVICE_USE_EXTERNAL. This variable is a boolean that determines whether you use the built-in database detection or a remote service. If MOBI_SERVICE_USE_EXTERNAL is set to 1 you should also check MOBI_SERVICE_URL to see which server you are pointed at.

conover commented 13 years ago

We are using the external service and the URL it is pointing at is https://modolabs-device.appspot.com/api/.

akinspe commented 13 years ago

We will be updating the external device detection to include updated values. It appears that we are still using values for an older version of the software. After we have made the changes, we will post the proper values (which will certainly involve at least an updated version value)

zootsuitbrian commented 13 years ago

The updated version for the device detection is planned to be deployed to production tommorrow. In the mean time the there is a test version that is currently live, you will need to use the following config values to use the test version of the service.

MOBI_SERVICE_VERSION = 2 MOBI_SERVICE_URL = "https://modolabs-device-test.appspot.com/api/"

zootsuitbrian commented 13 years ago

The external device detection at https://modolabs-device.appspot.com/api/ has been updated.

Also the kurogo code base default config for external device detection has been bumped up to MOBI_SERVICE_VERSION = 2