2010-10-20 84 views
19

CocoaTouch/iOS中是否有API用于检测无线网络?我想编写一个应用程序,保存手机在给定时刻可以看到的网络列表。iOS API检测无线网络

+2

可能重复[在iPhone上,是有可能找到使用我们连接到哪个WIFI网络?](http://stackoverflow.com/questions/2637094/on-the-iphone-is-it-possible-to-find-out-which-wifi-network-we-are连接到) – 2010-10-20 20:57:24

+3

另请参阅[iPhone SDK是否可以获取当前连接到的Wi-Fi SSID?](http://stackoverflow.com/questions/339089/can-the-iphone-sdk-obtain-the-wi -fi-ssid-currently-connected-to),[正在访问的当前网络](http://stackoverflow.com/questions/2643011/current-network-being-accessed),[如何枚举所有可用的Wi fi网络在范围?](http://stackoverflow.com/questions/3019336/how-to-enumerate-all-available-wifi-networks-at-range) – 2010-10-20 20:58:43

回答

4

就我所知,您可以使用CNCopySupportedInterfacesCNCopyCurrentNetworkInfoCaptiveNetwork来获取有关当前连接的Wi-Fi的信息。你可以参考: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. 

你可以看看iphone-wireless项目,如果你有兴趣Apple80211。有一个示例应用程序“Stumber”,它正是你想要的。但是你不能在你的应用程序,如果你想要发布到App Store的,因为它使用的是专用的API