Reputation: 41
I am trying to get the wifi list, but I get a blank array every time.
I'm using below code:
NEHotspotConfigurationManager.shared.getConfiguredSSIDs { (ssidsArray) in
print("ssidsArray.count==\(ssidsArray.count)")
for ssid in ssidsArray {
print("Connected ssid = ",ssid)
}
}
How to get all connected wifi's list programmatically in swift
Upvotes: 1
Views: 1212
Reputation: 1003
Please carefully read documentation for getConfiguredSSIDs(completionHandler:) function:
Returns the SSIDs or the names of the Wi-Fi hotspot domains that YOUR APP has configured and invokes an optional completion handler.
It means that the function lists configurations that were applied by your application using apply(_:completionHandler:) function.
Probably Hotspot Helper can do what you want but you'll need to submit a justification to Apply why you need this functionality.
Upvotes: 1