Question

I would like my website to show mobile visitors that their device make and model is recognized. I am aware of Javascript scripts that tell me whether a device is a mobile phone or a tablet, but what I need here is the actual make and model (HTC One, BlackBerry Storm, and so on). I am also aware of tools such as WURFL, but this would require me to perform the sort of PHP development that seems overkill for this kind of feature.

Am I asking for too much?

Was it helpful?

Solution

Luca Passani, WURFL inventor here. My company recently launched this service which pretty much solves the problem you mentioned free of charge. I advise you check out http://wurfl.io/

In a nutshell, if you import a tiny JS file:

<script type='text/javascript' src="//wurfl.io/wurfl.js"></script>

you will be left with a JSON object that looks like:

{
 "complete_device_name":"Google Nexus 7",
 "is_mobile":true,
 "form_factor":"Tablet"
}

(that's assuming you are using a Nexus 7, of course) and you will be able to do things like:

if(WURFL.form_factor == "Tablet"){
    //dostuff();
}

Or

modelName = WURFL.complete_device_name

This is what you are looking for. Please observe that the service also correctly detects specific iPhone models, which was a rather hard nut to crack.

I see someone commented that maintaining the list of devices would be a big task. He would be correct, if it wasn't that the service is doing it for you, so you don't need to keep anything updated.

Thanks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top