0

What's the best way to detect if a user is using an actual mobile device (iPhone/Android) as opposed to a simulated user-agent or dev tools?

It's related to preventing fraud, and I know there's always ways around stuff like this, but my goal here is to just eliminate the 80% attempts that will give up rather than 100% prevention.

I've tried googling and I can only find using a user-agent which obviously won't work.

Tallboy
  • 12,847
  • 13
  • 82
  • 173
  • @Tallboy to make this clearer: You want, usign JavaScript, to detect what device is active – Zoe Jul 27 '17 at 21:10
  • I want to see if someone is using a REAL device (like ios safari on iPhone 6) rather than chrome dev tools with device emulation on. I know its possible because lots of malware uses this by accessing the phones GPS etc, which chrome desktop obviously doesnt have access to. I just want the most reliable way. I dont really care about knowing the exact device they're using, as long as its iphone or android device. – Tallboy Jul 27 '17 at 21:11
  • While you may have a very good reason for doing this, you're generally better off detecting features (or lack of them) than specific browsers. For example, navigator.geolocation can help you check for gps capabilities. If you can share more about your reasons, it's possible that someone here could help address the underlying need in a different way, too. – Daniel Jul 27 '17 at 21:25
  • @Daniel thats fine but how do I detect features, and what features do I detect? That's mostly the crux of the problem. – Tallboy Jul 27 '17 at 21:32
  • Well that depends on what features you need for your application / web page. What are you trying to use? – Daniel Jul 27 '17 at 22:18
  • I have an app where people can install apps for monetization (incentivized installs) but I dont want people clicking links if they're on desktop. – Tallboy Jul 27 '17 at 23:12

0 Answers0