0

I'm using 51 Degrees in .NET on MVC and it's only just come to my attention that 51 degrees redirects Tablets as default with what it classes as IsMobile.

I only want to redirect mobile traffic, ie phones etc and not tablets. Tablets should be using my default "Desktop" layout.

Is there anyway I can use the (Lite) 51 Degrees to only redirect mobile traffic and not tablet traffic?

Chris Lomax
  • 137
  • 2
  • 12

2 Answers2

1

I don't know anything about their normal redirect configuration, but you can handle this easily on the server side. 51Degrees adds the "IsTablet" and "IsSmartPhone" properties to request.Browser. You could do this where appropriate:

var request = HttpContext.Current.Request; //or wherever you're getting it from
bool smartPhoneFlag, tabletFlag;
bool.TryParse(request.Browser["IsTablet"])
bool.TryParse(request.Browser["IsSmartPhone"])

if(smartPhoneFlag && !tabletFlag)
{
    //redirect
}
//else continue on
Facio Ratio
  • 3,373
  • 1
  • 16
  • 18
  • Those are indeed properties that are available, however not in the LITE subscription as Chris originally indicated. @Chris: did you find a solution for this problem yet? I could use it as well... ;-) – verfailliep Jan 09 '15 at 09:55
0

A bit late to this but i'm one of the engineers over at 51Degrees. We now offer a free basic Cloud service that gives access to the "IsTablet" property. This can then be used to tailor your re-direct options.

A basic example of calling against this option would look like:

https://cloud.51degrees.com/api/v1/*LICENCE_KEY*/match?user-agent=iphone&Values=IsTablet
Josh Grew
  • 211
  • 3
  • 6