validide/mobile-detect

Does this work? Any plans for a nuget package?

Closed this issue · 7 comments

Hi,

I'd be interested to use this library but not sure if this is working and up to date?
Wondering if there are plans to build a nuget package.

Hi,

I only used this on a small project and it worked. I was planning to create a NuGet but I never got the time to do it and I don't think I will get to it in the upcoming weeks.

I see. Thanks a lot for sharing, the code looks pretty neat!
I just have a couple of questions.

  1. How do I use it? Do I just do new MobileDetector(DefaultRules.Instance, requestHeaders) ?
  2. How did you generate DefaultRules.generated.cs? I'm wondering in case I would want to regenerate it based on the latest data.

Oh I think you would have used the json file...

  1. Yes, you should instantiate a new object and pass in the rules object and the request headers in a dictionary format. The rules can be the default ones or your own implementation of them. You can take a look at some of the unit tests.

var detector = new MobileDetector(rules, requestHeadersSictionary);

  1. To update the rules you should update the './_build/regenerate-matching-rules.ps1' file and change the value for $jsonVersion = '2.8.24' to the latest tag of Mobile Detect (2.8.26 I think). After this just run the script.

Hi,

I upgraded the project .Net Core 2.0 and also the User Agent strings.
You can find a basic usage example on the home page and the NuGet package here.

Thank you so much.
I will definitely give it a try as soon as my project is upgraded to asp.net core 2.0

All done. I pulled the package and it is running nicely in production.
Thanks again!