How to Find Wifi Mac Address in Android

Please anyone tell me how we can find mac address in ionic 4 and use that mac address as a string in a var. Thank you

Check this plugin

declare var WifiInfo

then on app constructor after the platform ready I use it like this.

this.platform.ready()
    .then(() => {
        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things
        // you might need.
        this.statusBar.styleDefault();
        this.splashScreen.hide();

        // console log an object with wifi info
        WifiInfo.getWifiInfo(wifiInfo => console.log(wifiInfo),
            wifiError => console.log(wifiError));
    });

This code return that.

{
"MacAddress" : "xx:xx:xx:xx:xx:xx",
"BSSID" : "xx:xx:xx:xx:xx:xx",
"HiddenSSID" : false,
"IpAddress" : "x.x.x.x",
"LinkSpeed" : 72,
"NetworkId" : 5,
"Rssi" : -40,
"SSID" : "\"xxx_xxx\""
}

Thank you so much this works for me :slight_smile: