I know in Windows Phone 7, it is impossible to get the IMSI and IMEI.
Is there a way to get IMSI and IMEI in Windows Phone 8?
I know in Windows Phone 7, it is impossible to get the IMSI and IMEI.
Is there a way to get IMSI and IMEI in Windows Phone 8?
There is no way to get IMSI and IMEI number, however you can use the device unique Id.
Use the following code snippet to get the device unique id.
Namespace is
using Microsoft.Phone.Info;
object uniqueId;
var hexString = string.Empty;
if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out uniqueId))
hexString = BitConverter.ToString((byte[])uniqueId).Replace("-", string.Empty);
MessageBox.Show("myDeviceID:" + hexString);
Hope it helps
You can also use this property
Windows.Phone.System.Analytics.HostInformation.PublisherHostId
If you use this property in your app, you must specify ID_CAP_IDENTITY_DEVICE capability in the app manifest.
This ID is supposedly a unique Hash not a device id per say. It does not seem to match with the ID that is sent from Windows phone to exchange server over EAS. In fact we see that when application performs a Sync with Exchange server, it sends all the details like IMEI number and correct device id. It is only from company apps that we are not able to retrieve these details.
You can get Device Unique Id using DeviceExtendedProperties.GetValue() property. Use the following code
byte[] myDeviceID = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
string DeviceIDAsString = Convert.ToBase64String(myDeviceID);