T.D
T.D

Reputation: 177

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

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

Upvotes: 7

Views: 2841

Answers (1)

Lily Ballard
Lily Ballard

Reputation: 185653

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

Upvotes: 8

Related Questions