WURFL Cloud always returns same properties
Posted: Mon Jun 22, 2015 4:16 am
Our company has purchased an account. We want to use this service to detect a very wide range of user agents. However, we want to wrap WURFL Cloud API in a C# ASP.NET MVC WEB API 2 set of APIs to reduce the dependency on this service.
I created a Console application and then a ASP.NET MVC application. In the console application I passed the user agent along with an array of expected capabilities. In the ASP.NET web site I passed both user agent and HttpContextBase.
In both cases I always get the same value for my capabilities although cookies are disabled. The returned value is almost empty because for a very common user agent such as iPhone, brand name, and model name are empty and the result states that the device is unable to play mp3 files!!
Here is my code:
var config = new DefaultCloudClientConfig
{
ApiKey = "-- api key here --"
};
var manager = new CloudClientManager(config);
var info = manager.GetDeviceInfo(HttpContext);
var caps = info.Capabilities.Select(v => string.Format("{0},{1}\n", v.Key, v.Value));
// or pass user agent
//var caps = info.Capabilities.Select(v => string.Format("{0},{1}\n", v.Key, v.Value));
No matter what user agent I pass in I always get either empty or wrong values (e.g. screen size is always 400x400).
What I am doing wrong?!
I created a Console application and then a ASP.NET MVC application. In the console application I passed the user agent along with an array of expected capabilities. In the ASP.NET web site I passed both user agent and HttpContextBase.
In both cases I always get the same value for my capabilities although cookies are disabled. The returned value is almost empty because for a very common user agent such as iPhone, brand name, and model name are empty and the result states that the device is unable to play mp3 files!!
Here is my code:
var config = new DefaultCloudClientConfig
{
ApiKey = "-- api key here --"
};
var manager = new CloudClientManager(config);
var info = manager.GetDeviceInfo(HttpContext);
var caps = info.Capabilities.Select(v => string.Format("{0},{1}\n", v.Key, v.Value));
// or pass user agent
//var caps = info.Capabilities.Select(v => string.Format("{0},{1}\n", v.Key, v.Value));
No matter what user agent I pass in I always get either empty or wrong values (e.g. screen size is always 400x400).
What I am doing wrong?!