Reputation:
How to get IMEI and IMSI number from windows Phone using Windows Phone 8.1 or UWP in c#
I used TAPIib.dll and OpenNETCF.Telephony.dll but both dll are only for webforms. Please help me for fetch the IMEI Number of the Windows Phone device Using C#
How do I find imei number in windows 8.1 phone programmatically? This Link is for windows phone 8 or windows Form. But we need for windows phone 8.1 and UWp
Is there any way to fetch the IMEI Number of the Windows Phone 10 device Using C#
Upvotes: 1
Views: 1103
Reputation: 302
The MobileEquipmentId would be that your want. From MSDN:
For GSM devices, the MobileEquipmentId value will be the International Mobile Equipment Identitiy (IMEI), which can be up to 15 digits long. For CDMA devices, the MobileEquipmentId value must be the electronic serical number (ESNs0, which is 11 digits long, or the mobile equipment identifier (MEID), which is 17 digits long.
I guess that you don't know how to use this API. Please following the below ways:
add xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
and Ignorable Namespaces as the following:
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp rescap">
add cellularDeviceIdentity capability as the following:
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="cellularDeviceIdentity" />
</Capabilities>
Then, you could use the following code to get IMEI number:
var modem = MobileBroadbandModem.GetDefault();
var imei = modem?.DeviceInformation.MobileEquipmentId;
But, please note This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.
Even if you could use this API in your local testing machine. If you want to publish your app to windows store, you would need privileged access by mobile network operators.
Upvotes: 1