Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

iphone

wifi

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

like image 224
T.D Avatar asked Dec 10 '12 20:12

T.D


People also ask

How can I see all available Wi-Fi networks?

After your Surface restarts, sign in to Windows. Go to Start, and select Settings > Network & internet > Wi-Fi > Show available networks, and see whether your wireless network name appears in the list of available networks.

Why can't I see all available wireless networks?

If no networks are shown in the list, your wireless hardware could be turned off, or it may not be working properly. Make sure it is turned on. You could be out of range of the network. Try moving closer to the wireless base station/router and see if the network appears in the list after a while.


1 Answers

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

like image 188
Lily Ballard Avatar answered Oct 09 '22 15:10

Lily Ballard