问题
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?
回答1:
CNCopySupportedInterfaces
and 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.
回答2:
As of iOS 9 Beta 4 CNCopySupportedInterfaces is deprecated. Much pain ensuing....
https://forums.developer.apple.com/message/31340#31340
来源:https://stackoverflow.com/questions/14706134/cncopysupportedinterfaces-gives-list-of-all-configured-wifi-interfaces-informati