0

I need to open wifi settings, I wrote this line

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

but it doen't work, i should add something else or ...? Maybe you can tell how can I open wifi -screen in my app. Thank you I use iOS 6.1. and

someone
  • 61
  • 1
  • 10

2 Answers2

1

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

Community
  • 1
  • 1
0

In ios < 5.1 apple was supporting shortcut urls like the one you described. But later for ios >= 5.1 apple discontinued it.

Shashank
  • 1,743
  • 1
  • 14
  • 20