Net Maui, get the serial number of the device

1.8k Views Asked by At

Is there a way to get te serial number of the device (android) in Net Maui?

I tried with the namespace Microsoft.Maui.Devices.DeviceInfo but It doesn't have it. I used to get it in Xamarin.Forms with the nuget Xam.Plugin.DeviceInfo (DeviceInfoPlugin). Is there something similar in Net Maui?

1

There are 1 best solutions below

0
Liyun Zhang - MSFT On

No, you can't get the serial number of the device since android 10.0. The official document about the restriction on non-resettable device identifiers said:

Starting in Android 10, apps must have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access the device's non-resettable identifiers, which include both IMEI and serial number.

And the READ_PRIVILEGED_PHONE_STATE permission is a system permission which can't be granted to the third party application.