Not able to identify iPad Pro devices by using Javscript

38 Views Asked by At

I am trying to identify iPad devices by using various methods in JS. As per the latest research on this, newer versions of iPad Pro behaving same as desktop versions(Same user agent). Since both iPad and Mac shows same user agent details, it's very difficult to differentiate iPad and Mac devices.

Can anyone help on this?

Thanks in advance

1

There are 1 best solutions below

2
Pasquale De Lucia On

You can try this way:

var isIPadPro = /Macintosh/.test(navigator.userAgent) && 'ontouchend' in document;