is it possible to get a unique identification number from a mobile device?

Viewed 75403

I am currently working on mobile device web applications, and I was wondering if there is some sort of unique id number per device that could be detected via the browser.

The purpose would be to store this number in order to recognize people who already visited the site.

I was working with bluetooth quite a lot, and there some sort of mac address you can store when you detect a device, and I was using this as Id number, so that's my question, is there a general ID number I can detect from the browser...?

Thanks.

6 Answers

This is an old question. Hope this helps someone in future.

Although "Experimental", MDN Web Docs now has a method to get deviceID. Except IE, all browsers are supported at this time. This solution seems to be better than nothing - as the ID is not reliable and I have to fill gaps with some custom workaround.

The deviceId readonly property of the MediaDeviceInfo interface returns a DOMString that is an identifier for the represented device and is persisted across sessions. It is un-guessable by other applications, and unique to the origin of the calling application. It is reset when the user clears cookies. For private browsing, a different identifier is used that is not persisted across sessions.

var deviceID = MediaDeviceInfo.deviceId
Related