问题
I have a windows phone 7 app which is live in store which is using DeviceExtendedProperties.GetValue("DeviceUniqueId") to fetch id and I am updating it in store with new windows phone 8 app and using same method.
In both cases I am getting different id? I want the id to be same in both the cases.
回答1:
Per this blog post:
For Windows Phone 8 apps running on Windows Phone 8 devices and later, the DeviceUniqueId value is unique per device and per app publisher, which means that two apps published by different windows phone store account won’t get the same “device unique id”.
As there is a compatibility issue for Windows Phone 7.x apps, it may be the case that the phone essentially has an id for 7.x apps, and defers to a different logic to return a per publisher version for 8.x apps
回答2:
Check this one:
byte[] id = (byte[])Microsoft.Phone.Info.
DeviceExtendedProperties.GetValue("DeviceUniqueId");
string deviceID = Convert.ToBase64String(id);
Checked WMAppManifest.xml -> Capabilities tab -> switch on ID_CAP_IDENTITY_DEVICE
来源:https://stackoverflow.com/questions/36004003/windows-phone-device-unique-id