Hey all,
I just started trying to mess around with the PHP API and the evaluation json downloaded from deviceatlas.
I'm pretty new to all of this, so I might be doing something wrong and have been looking at the following tutorial for guidance: http://mobiforge.com/developing/story/the-deviceatlas-api-php-part-i-the-basics
The first thing I wanted to do was to pull out some different values, like vendor, displayHeight etc and to start of with echo out displaywidth. I did this by doing the following:
<?php
try{
$vendor = Mobi_Mtld_DA_Api::getProperty($tree, $ua, 'vendor');
$model = Mobi_Mtld_DA_Api::getProperty($tree, $ua, 'model');
$d_height = Mobi_Mtld_DA_Api::getProperty($tree, $ua, 'displayHeight');
$d_width = Mobi_Mtld_DA_Api::getProperty($tree, $ua, 'displayWidth');
$pngSupport = Mobi_Mtld_DA_Api::getProperty($tree, $ua, 'image.Png');
} catch (Mobi_Mtld_Da_Exception_InvalidPropertyException $e) {
$vendor = "Unknown";
$model = "Unknown";
$d_height = "Unknown";
$d_width = "Unknown";
$pngSupport = "Unknown";
}
echo "- ".$d_width."";
?>I visited the test page with my Iphone and got a 320px width which seems correct. I then tested it on three other phones. The X1, Sony Ericsson W995 + W302 and on all three I got my fallback - "Unknown"
Is this because of restricted access in the evaluation json?