51Degrees / Device-Detection

THE Fastest and most Accurate device detection for C / PHP / Perl / Python and Node.js - professionally maintained device data
https://51degrees.com/device-detection
Other
112 stars 46 forks source link

get DeviceId by ProfileId, get ProfileId by DeviceId #41

Closed PavMel closed 5 years ago

PavMel commented 5 years ago

Sorry for this issue, but I have read all documentation a few times(many times) and didn't find any related info. I have 2 question: 1) I have ProfileId( e.g 11625), how I can get DeviceId? 2) I have DeviceId (e.g 91279-80764-84765-18092), how I can get ProfileId?

JoshGrew51D commented 5 years ago

I can see that you have used some of the methods I will mention in your other issue but I think it would be helpful to just go through how we categorize a device and provide a bit more detail on the difference between a ProfileId and a deviceId

There are 4 parts that make up the definition of a device:

These 4 foundations make the Device Id. Each of these dimensions are considered a profile and as such have a corresponding profile Id.

If you only have 1 piece, in your case 11625, you can only identify the profile it references. E.g. Hardware data. You cannot retrieve a full device by only providing 1 of 4.

On the other hand if you have the full Device Id, 91279-80764-84765-18092, you can retrieve all the associated information about the device.

The list i have added above shows the order in which the profile ids join together to make the device id.

You can retrieve the Device Id from a match of the User-Agent but you can also match device information using either a partial or full device id. This would be done using the method MatchForDeviceId().

Hope that helps clear things up. Any questions let me know.

PavMel commented 5 years ago

Thank you very much for your answer. Issue resolved.