Prerna Dwivedi

Prerna Dwivedi

  • NA
  • 96
  • 7.9k

How to get IMEI in API 11 Using Xamarin Form

Jul 13 2021 8:43 AM

I am using this code...

 public string GetIdentifier()
        {
            TelephonyManager manager = (TelephonyManager)Forms.Context.GetSystemService(Android.Content.Context.TelephonyService);

            return manager.Imei;
           
        }

var deviceInfo = Xamarin.Forms.DependencyService.Get<TestMobileAppWebAPI.Models.IDeviceInfo>();
             var number = deviceInfo.GetIdentifier();
            lblIMEI.Text = number.Trim();

but i  am getting error

Java.Lang.SecurityException: 'getImeiForSlot: The user 10308 does not meet the requirements to access device identifiers.'


Answers (2)