The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Unique Device ID not returning GUID? RRS feed

  • Question

  • Hello, I have a simple question. I only have one phone to test with but I need my App to work for a company running 300-400 phones.

    I was under the impression that getting the device ID returned a 32 character GUID. When I run this code:

    Byte[] DeviceArrayID = (Byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
    string UniqueDeviceID = Convert.ToBase64String(DeviceArrayID);

    I get 28 characters such as qVROZp8LUJlhEBQmbbHTeM5JwSo=

    While I'm sure this will be more than unique for my purposes, I'm just worried I'm not doing something right since I'm not getting the expected output, and I want to be confident that 1) I don't get the same value for more than one phone, and 2) the value won't change per device for this app. Can anyone confirm that this output is actually what should be expected?

    Thanks

    
    • Edited by imscavok Monday, December 16, 2013 3:16 PM
    Monday, December 16, 2013 3:15 PM

All replies

  • I think you need ANID2.

    http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/03/11/migrating-anids-to-windows-phone-8.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, December 16, 2013 8:40 PM
  • Since you said you need an ID per phone and not per user, then you can stick with the DeviceUniqueID.  It will truly be unique per device even though it is not returning a GUID.  The only question that you may have to look at is if you port a Windows Phone 7 application to Windows Phone 8, then the DeviceUniqueID may return a different value in the Windows Phone 8 version of the application that it did in the Windows Phone 7 version as the library uses the PublisherID of the application in generating the ID, preventing two different publishers from comparing phone IDs.

    Tuesday, December 17, 2013 7:11 AM