How to detect all available Wifi networks and connect to one of them in an iOS app

…衆ロ難τιáo~ 提交于 2019-12-10 13:43:12

问题


In my iOS app, I want to detect all available wifi networks and then choose one network form the list and connect to it. The goal is to not open the Settings built in app to connect to a wifi, but to do it all in my app.

First, is this possible? If possible, please point me to what framework(s) and methods to use.

I have looked at the Reachability example, but that doesn't work for me because, I think, all it does is monitor the network state of the device.

I also looked at the Captive Network Support framework, and used the CNCopySupportedInterfaces function:

CFArrayRef allWifiNetworks = CNCopySupportedInterfaces();

NSLog(@"%@", allWifiNetworks);

but all I am seeing is the current wifi network that the device is connected to.

Thanks


回答1:


I'm pretty sure you can't do this, at least not if you want to be able to publish on the App Store.



来源:https://stackoverflow.com/questions/13808492/how-to-detect-all-available-wifi-networks-and-connect-to-one-of-them-in-an-ios-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!