Reputation: 1076
I need to find out on which Windows phone device my app is running. Is there a reliable way to find out the IMEI in WP8? If not, is the DeviceName and DeviceManufacturer field reliably filled in by most devices? The documentation says those fields may be empty.
Upvotes: 0
Views: 4641
Reputation: 503
You could use
//Device Name
Microsoft.Phone.Info.DeviceStatus.DeviceName
//Device Unique Identifier (not IMEI)
Convert.ToBase64String((byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId")))
//Device Manufacturer
Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer
Hope this helps someone
Upvotes: 1
Reputation: 129
DeviceExtendedProperties.GetValue(“DeviceUniqueId”) works as stated on Windows Phone 7 but on Windows Phone 8, this API will return unique id common across all the apps for the same publisher on a wp8 device. But two different publisher's apps will have different device ID's.
Upvotes: 0
Reputation: 1713
This may work on Windows Phone 7. Maybe, it will also work on Windows Phone 8.
byte[] byteData = (byte[])DeviceExtendedProperties.GetValue(“DeviceUniqueId”);
string imei = System.Convert.ToBase64String(byteData);
Upvotes: 0