3

I need to send a unique ID of the device to the server for some requirements at the server. So after some research, I used the following

new EasClientDeviceInformation().Id.ToString();

But, during testing, I found that it is giving the same value for the emulator and my Lumia device.

Also, I got The Id property represents the DeviceId using the GUID truncated from the first 16 bytes of the SHA256 hash of the MachineID, User SID, and Package Family Name where the MachineID uses the SID of the local user's group. Each component of the GUID is returned in network byte order.

Does EasClientDeviceInformation don't give unique id?

Kinjan Bhavsar
  • 1,439
  • 28
  • 58
  • Why can't you just identify the App instead of the Device? Create a unique GUID for the app and save it in IsolatedStorage? – Cheesebaron Aug 29 '16 at 11:04

1 Answers1

3

You need to add a reference to "Windows Desktop Extensions for the UWP" assembly and then:

var token = HardwareIdentification.GetPackageSpecificToken(null);
var hardwareId = token.Id;

See this articles:

Device ID in a UWP app (threshold 1)

How do I get a Unique Identifier for a Device within Windows 10 Universal?

Community
  • 1
  • 1
Igor Damiani
  • 1,897
  • 9
  • 12