Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Howto Access WiFi Settings programmatically in iOS 5.1

Tags:

wifi

ios5.1

I'm looking for a smart way letting the user of my app connect to a WiFi Network. I know how to detect if the device is connected or not. I tried to use URL's to direct the User to the correct prefs Page. Unfortunately this doesn't work anymore. Any suggestions on howto require users to connect to WiFi???

thanks for helping!!!

like image 775
sensslen Avatar asked Nov 14 '22 08:11

sensslen


1 Answers

Try using it to access the WiFi settings in iOS 5.1

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];

Try using it to access the WiFi settings in iOS 9

if (&UIApplicationOpenSettingsURLString != NULL) { 
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]]; 
}

Try to add prefs tu URL schemes like stackoverflow.com/a/31253743/3668465 did.


You can use this option for identify a SSID:

iOS >= 4.1 it's possible to obtain SSID of wireless network that device is currenctly connected to.

For this you'd use function CNCopyCurrentNetworkInfo

Details on implemenation: iPhone get SSID without private library


question example -> how to programmatically open the WIFI settings in objective c in iOS9

like image 169
Helton Fernandes Sampaio Avatar answered Jan 08 '23 03:01

Helton Fernandes Sampaio