Post

Replies

Boosts

Views

Activity

Reply to CNCopyCurrentNetworkInfo is returning nil in iOS 13
the same for me.details:a) demo app, works fine on iPhone 11 (ios 13)b) does nto work on iPhone 6plusfix: reboot iPhone6 !!anyway:1) you must add usual keys (for geloc !)NSLocationAlwaysAndWhenInUseUsageDescriptionNSLocationAlwaysUsageDescriptionNSLocationUsageDescription</key>NSLocationWhenInUseUsageDescription2) add usual dance in permission:....import CoreLocationclass ViewController: UIViewController, CLLocationManagerDelegate { // for iOS13: var locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() if #available(iOS 13.0, *) { let status = CLLocationManager.authorizationStatus() if status == .authorizedWhenInUse { updateWiFi() } else { locationManager.delegate = self locationManager.requestWhenInUseAuthorization() } } else { updateWiFi() } } func updateWiFi() { let arr = currentSSIDs() print(arr) } func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { if status == .authorizedWhenInUse { updateWiFi() } }}func currentSSIDs() -> [String] { guard let interfaceNames = CNCopySupportedInterfaces() as? [String] else { return [] } return interfaceNames.flatMap { name in print(name) guard let info = CNCopyCurrentNetworkInfo(name as CFString) as? [String:AnyObject] else { return nil } guard let ssid = info[kCNNetworkInfoKeySSID as String] as? String else { return nil } return ssid }}I started form Eskimo sample.(see also at:// see: https://github.com/HackingGate/iOS13-WiFi-Info)
Dec ’19