Detect Wifi SSID in Xamarin MAC application

Viewed 125

I have a xamarin.MAC application built using Xamarin.MAC. Now I need to find a way to get the connected Wifi SSID in MAC application. I see lot of solution for xamarin.ios.But couldn't see the solution for MAC Application. Do any one know how can I detect SSID in the Xamarin.MAC application?

Thanks in Advance

Roshil

1 Answers

Use the CoreWLan framework, something like this will get you started:

var client = CWWiFiClient.SharedWiFiClient;
foreach (var @interface in client.Interfaces) // you can have multiple wifi devices connected at once
{
    if (@interface.DeviceAttached)
    {
        Console.WriteLine(@interface.Ssid);
    }
}

re: https://developer.apple.com/documentation/corewlan/cwwificlient

Related