I have a Mac mini (2012) with macOS Catalina 10.15.7. So NEHotspotNetwork.fetchCurrent() is not available. Here is my test code:
mLocationManager = CLLocationManager()
mLocationManager!.delegate = self
mLocationManager!.requestAlwaysAuthorization()
...
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
print("status: \(status.rawValue)")
let interfaces = CNCopySupportedInterfaces() as NSArray?
print("interfaces: \(interfaces!.count)")
let interface = interfaces![0] as! CFString
print("interface: [\(interface)]")
let info = CNCopyCurrentNetworkInfo(interface) as NSDictionary?
if (info == nil) {
print("info: nil")
} else {
print("info: not nil")
}
}
// OUTPUT:
status: 0 (notDetermined)
interfaces: 1
interface: [en0]
2022-08-03 10:43:23.335260+0100 DimensionX[3066:1830775] [] nehelper sent invalid result code [1] for Wi-Fi information request
info: nil