How can I find and list all the wi-fi networks in range?
1 Answers
As far as I know you can get the information about the current connected Wi-Fi using CNCopySupportedInterfaces
and CNCopyCurrentNetworkInfo
of CaptiveNetwork. You can refer to: How do I use CaptiveNetwork to get the current WiFi Hotspot Name for more information.
According to iPhone get a list of all SSIDs without private library:
Without the use of private library (Apple80211) you can only get the SSID of the network your device is currently connected to.
You could have a look at iphone-wireless project if you are interested in Apple80211. There exists a sample app "Stumber" which does exactly what you want. But you cannot use this in your app if you want to publish to App Store because as it uses private APIs. Apple rejects apps those use private APIs.
-
Thanks @Halley but I don't need the information about the current connected wi-fi I need to list all the wi-fi networks available, my iphone can detect.. I try with the iphone-wireless project but this does not work for me.. :/ any idea. – NTTake Apr 25 '12 at 19:44
-
2You can't take the list of wifi network, unless using private APIs... But The use of private APIs will reject your application. – Marco Pace May 07 '12 at 08:50
-
@MarcoPace. Any idea on http://stackoverflow.com/questions/34586378/how-to-get-all-previously-connected-wi-fi-networks-in-swift ? – Ashok Jan 04 '16 at 10:20
-
@AshokKumarS never used that code before because is in Swift, but for now it seems that the best solution is to check info in the /private/var/Keychains/keychain-2.db file. – Marco Pace Jan 07 '16 at 09:04
-