2

I want to use the CNCopySupportedInterfaces API to get the SSID of Wifi interface. But I just have doubt about the API CNCopySupportedInterfaces. Will this API provide a list of all configured Wifi interfaces or only one which is currently active or info about all access points that are reachable (but not configured) at that moment?

wjl
  • 7,143
  • 1
  • 30
  • 49
NNR
  • 59
  • 1
  • 7

2 Answers2

6

CNCopySupportedInterfacesand CNCopyCurrentNetworkInfo of CaptiveNetwork, will gives only your connected wifi name and detail, Without the use of private library (Apple80211) it will not provide you other reachable wifi list or other info.

You can refer to: How do I use CaptiveNetwork to get the current WiFi Hotspot Name for more information.

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.

Community
  • 1
  • 1
Rajneesh071
  • 30,846
  • 15
  • 61
  • 74
  • Thanks for the quick reply. So If I configure two WIFI access points to my device and only one is active at that time I could get only the active network info is that correct...? and is there a way to get the list of all configured WIFI access point names. – NNR Feb 05 '13 at 11:32
  • yup using stumber library, but its third party and apple will reject this app with library – Rajneesh071 Feb 05 '13 at 11:46
  • Thank you very much I will go through that once. – NNR Feb 05 '13 at 12:27
  • @Rajneesh071 Can we use private api to fetch all wifi hotspots ssid,bssid, signal strength and upload app using enterprise account on clients devices? – Ayaz Alavi Dec 22 '14 at 00:46
  • Yes you can but on jailbreak device. – Rajneesh071 Jan 03 '15 at 17:51
  • This sounds perfect for getting the currently connected network. Unfortunately I can't find a proper reference from apple that guarantees, that only the currently connected network is returned. If that would be the case, why return an array? I don't want the code to give me the wrong SSID in some edge-case where CNCopySupportedInterfaces returns multiple interfaces – MikeB Apr 30 '18 at 09:39
-1

As of iOS 9 Beta 4 CNCopySupportedInterfaces is deprecated. Much pain ensuing....

https://forums.developer.apple.com/message/31340#31340

sean808080
  • 242
  • 4
  • 13