title: Get Unique Device ID (UDID) under Windows Phone 8
body: <p>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.?</p>
  
  <p>In older Windows Phone versions there were such IDs:
  WP7: <a href="http://msdn.microsoft.com/en-us/library/ff941122(v=VS.92).aspx" rel="noreferrer">Device Status for Windows Phone</a></p>
  
  <p>WP7.1: <a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.info.devicestatus(v=vs.92).aspx" rel="noreferrer">DeviceStatus Class</a></p>
  
  <p>But they doesn't work anymore with SDK 8.0.</p>
  
  <p><strong>Why I ask:</strong>
  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.</p>
  
  <p>---///---SOLUTION----------</p>
  
  <p>I can confirm that DeviceExtendedProperties.GetValue("DeviceUniqueId") still works in WP 8.0. Got a little bit confused when I read the following text:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.info.deviceextendedproperties%28v=vs.105%29.aspx" rel="noreferrer">MSDN:DeviceExtendedProperties Class</a></p>
  
  <p>I can run the following code, delete the app and re-install it and get the same ID:</p>
  
  <pre><code>byte[] myDeviceID = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
  string DeviceIDAsString = Convert.ToBase64String(myDeviceID);
  MessageBox.Show(DeviceIDAsString);
  </code></pre>