List available WiFi networks in Sonoma

Hi,

I am trying to get a list of available WiFi networks for a sandboxed macOS app:

CWInterface *wifi = [[CWWiFiClient sharedWiFiClient] interface];
NSError *err;
NSSet *scanset = [wifi scanForNetworksWithSSID:nil error:&err];
// scanset is always empty (but not nil), no error is writting to "err"

With macOS Sonoma the code always returns an empty list (with older macOS version it works fine). I already added Location permission (as described here: https://developer.apple.com/forums/thread/732431).

Getting the currently connected WiFi SSID (using [CWInterface interface].ssid), as well as connecting to a WiFi network works.

How can I get a list of available WiFi SSIDs in macOS Sonoma?

Regards,

Answered by DTS Engineer in 782042022

If you temporarily disable the sandbox, do things start working?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

If you temporarily disable the sandbox, do things start working?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks, I got it working (also in the sandbox). It was a fault on my side.

List available WiFi networks in Sonoma
 
 
Q