Post

Replies

Boosts

Views

Activity

Reply to What is required to register for CoreWLAN events?
So I've been struggling with this lately on catalina with Xcode 11.3.1 but finally have a solution that works. I can listen for every event without an error except for virtualInterfaceStateChanged. This was throwing the vague error Domain=com.apple.wifi.request.error Code=4 "(null)". Below is my working implementation with a macOS project. class WiFiService: CWEventDelegate { private let wifiClient = CWWiFiClient.shared() init() { self.wifiClient.delegate = self do { try self.wifiClient.startMonitoringEvent(with: .virtualInterfaceStateChanged) } catch { print("Failed to register for wifi events: \(error)") } } func ssidDidChangeForWiFiInterface(withName interfaceName: String) { guard let interface = self.wifiClient.interface(withName: interfaceName) else { return } print(interface.ssid()) } }I hope this solves the problem for those that had this issue as it was the first result on google for me. Below are my entitlements. I figure because its fine with the Sandbox entitlement that I can push this to the appstore without issue?<dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.network.client</key> <true/> </dict> </plist>
Feb ’20