(that's assuming you are using a Nexus 7, of course) and you will be able to do things like:
if(WURFL.is_mobile){
//dostuff();
}
As an important aside, we go out of our way to recognize iPhone actual models by exploiting javascript (this allows us to exploit info that is not available through sheer analysis of the HTTP headers)
Please note that I work for the company that offers this free service. Thanks.
$device = $wurflManager->getDeviceForUserAgent($_SERVER["HTTP_USER_AGENT"]);
if ($device->getCapability("device_os") == "iPhone OS") {
// device is an iPhone or iPod
}
iOS devices can be identified by checking the device OS capability:
Assuming you've setup a WURFL manager already:
$device = $wurflManager->getDeviceForUserAgent($_SERVER["HTTP_USER_AGENT"]);
if ($device->getCapability("device_os") == "iPhone OS") {
// device is an iPhone or iPod
}
As an alternative answer you might want to consider 51Degrees.mobi. See this blog post for PHP integration, although it will involve running an IIS .NET services alongside.
发布评论
评论(3)
这里是 CTO @ScientiaMobile 和 WURFL 创建者。我建议你查看 http://wurfljs.com/
简而言之,如果你导入一个小 JS 文件
:将留下一个如下所示的 JSON 对象:(
当然,假设您使用的是 Nexus 7),您将能够执行以下操作:
重要的是,我们会竭尽全力识别 iPhone 的实际型号通过利用 javascript(这允许我们利用无法通过纯粹分析 HTTP 标头获得的信息)
请注意,我为提供此免费服务的公司工作。谢谢。
CTO @ScientiaMobile and WURFL creator here. I advise you check out http://wurfljs.com/
In a nutshell, if you import a tiny JS file:
you will be left with a JSON object that looks like:
(that's assuming you are using a Nexus 7, of course) and you will be able to do things like:
As an important aside, we go out of our way to recognize iPhone actual models by exploiting javascript (this allows us to exploit info that is not available through sheer analysis of the HTTP headers)
Please note that I work for the company that offers this free service. Thanks.
可以通过检查设备操作系统功能来识别 iOS 设备:
假设您已经设置了 WURFL 管理器:
iOS devices can be identified by checking the device OS capability:
Assuming you've setup a WURFL manager already:
作为替代答案,您可能需要考虑 51Degrees.mobi。请参阅此博客文章用于 PHP 集成,尽管它将涉及同时运行 IIS .NET 服务。
As an alternative answer you might want to consider 51Degrees.mobi. See this blog post for PHP integration, although it will involve running an IIS .NET services alongside.