2010-10-20 42 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