Im still so confused on how to simply get a network SSID for a background application running DotNet Core on macOS now. Before, I could just call CWifiClient.networkInterfaces, now the value returns null. What steps do I need to take to enable this application which is signed with its own embedded provisioning profile? Do I detect if authorization is required, then request the prompt?
#if _UNIX
using System;
using CoreWlan;
using CoreLocation; //???
using ThreadNetwork;
namespace Amazon.PersistUserService.Controllers.NetworkController.NetworkChangeManager;
public class MacNetworkChangeManager: INetworkChangeManager
{
private readonly CoreWlan.CWWiFiClient networkClient;
private CLLocationManager locationManager; //???
public MacNetworkChangeManager()
{
networkClient = CWWiFiClient.SharedWiFiClient;
}
public string? GetConnectedSsid()
{
//What do I add here to request authorization?
foreach (var @interface in networkClient.Interfaces) // you can have multiple wifi devices connected at once
{
return @interface.Ssid;
}
return null;
}
}
#endif