Helton Fernandes Sampaio Helton Fernandes Sampaio - 6 months ago 304
Objective-C Question

how to programmatically open the WIFI settings in objective c in iOS9

I'm trying to access the WIFI settings through my application using Objective-C. But can not find any way. Could someone help me?

Already tested with:

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


Does not work on iOS 9.

Answer

This is my code

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