Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there any unique device ID (UDID) or any similar ID I can read out on Windows Phone 8 (WP8) that doesn't change with hardware changes, app-reinstallation etc.?

In older Windows Phone versions there were such IDs: WP7: Device Status for Windows Phone

WP7.1: DeviceStatus Class

But they doesn't work anymore with SDK 8.0.

Why I ask: The idea is that a user gets some free credits with the first start of the the app and I want to avoid that the user just re-installs the app for getting new free credits. A registration with email or phone number could solve this, but if I can, I don't want do bother users at the first start with a registration.

---///---SOLUTION----------

I can confirm that DeviceExtendedProperties.GetValue("DeviceUniqueId") still works in WP 8.0. Got a little bit confused when I read the following text:

In Windows Phone OS 7.0, this class was used to query device-specific properties. In Windows Phone OS 7.1, most of the properties in DeviceExtendedProperties were deprecated, and the new DeviceStatus class should be used instead. However, where appropriate, you can still use any of the below properties that are not deprecated.

MSDN:DeviceExtendedProperties Class

I can run the following code, delete the app and re-install it and get the same ID:

byte[] myDeviceID = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
string DeviceIDAsString = Convert.ToBase64String(myDeviceID);
MessageBox.Show(DeviceIDAsString);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
316 views
Welcome To Ask or Share your Answers For Others

1 Answer

I haven't yet started to develop for Windows Phone 8, still on 7, but you still should be able to use the original DeviceExtendedProperties class to pull back the Device Unique ID.

DeviceExtendedProperties.GetValue("DeviceUniqueId")

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...