How to get Mac Address?


#1

Hi!

I use the Uid for get the mac address but always return ‘uid.MAC: 02:00:00:00:00:00’

In my constructor i have:

constructor(private uid: Uid) {

       console.log("uid.MAC: ", uid.MAC);
}

in app.component i have:

 androidPermissions.checkPermission(this.androidPermissions.PERMISSION.READ_PHONE_STATE)
       .then(result => {
                    
         if(!result.hasPermission) {
            androidPermissions.requestPermission(this.androidPermissions.PERMISSION.READ_PHONE_STATE);    
         }
 }

What am i doing wrong?


#2

It seems like it’s no longer possible to get the real MAC address this way.

Access to Hardware Identifier
To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs. The WifiInfo.getMacAddress() and the BluetoothAdapter.getAddress() methods now return a constant value of 02:00:00:00:00:00.