Xamarin.Android: Unable to get device Mac Address in Android-11

1.9k views Asked by At

I have developed an appliation which get the device mac address and then query from the database. Previously my app was working fine but now I am migrating to Android-11 and not able to get Mac address. I don't have real device for testing/debugging but my client reported that he is not having mac address. Can any body please guide why I am having working app not working for latest android versions or if there is any critical update.

1

There are 1 answers

0
user6159419 On BEST ANSWER

I found, Working with MAC for unique device identification is not best practice. Instead using MAC address we should use Android ID. https://www.appsflyer.com/mobile-attribution-glossary/device-id/

var deviceId = Plugin.DeviceInfo.CrossDeviceInfo.Current.Id;

Plugin.DeviceInfo.CrossDeviceInfo - i have used "DeviceInfoPlugin"

https://github.com/jamesmontemagno/DeviceInfoPlugin