Reputation: 833
I use the DeviceUniqueId
property of the DeviceExtendedProperties
object to identify a device on my Windows Phone apps.
On Windows Phone 7, it worked perfectly, and the device id remained stable across all the apps.
I migrated my apps to Windows Phone 8 (targeting both WP7 and 8), and it still worked as usual.
However, I've just developed an app that only targets WP8, and I have noticed that the DeviceUniqueId
is different than the one of my other apps (running on the same device).
To be sure, I created a few other test apps.
Here is an example on the same device (Nokia Lumia 820) :
Is this intended ? Is it possible to get a fixed device id for the WP8-only apps ?
I am unable to find any formal documentation about this behavior on MSDN.
Thanks.
Upvotes: 4
Views: 2380
Reputation: 46
For Windows Phone 8, definition on MSDN is:
For Windows Phone 8 apps running on Windows Phone 8 devices and later, the DeviceUniqueId value is unique per device and per app publisher. For Windows Phone 8 apps, DeviceUniqueId is functionally identical to the HostInformation.PublisherHostId property in the Windows Runtime.
Link to MSDN - DeviceExtendedProperties Class
Upvotes: 1
Reputation: 16826
According to the official MSDN document:
DeviceUniqueId - A unique hash for the device. This value will be constant across all applications and will not change if the phone is updated with a new version of the operating system. Applications should not use this to identify users because the device ID will remain unchanged even if ownership of the device is transferred.
In Windows Mobile 6.5 the hash was app-specific. This is not the case for Windows Phone. That being said, however, the ID is publisher-specific. Try changing the publisher GUID in the manifest and you will see what happens.
Upvotes: 2