Within iOS framework, how can one check if the Wifi radio is enabled by the user or not? Please note that I\'m not interested in the reachability through Wifi but rather if
iOS has no public API that tells you if Wi-Fi is on or off.
However, you can use the public API CNCopyCurrentNetworkInfo(), available in SystemConfiguration framework, to get info about the current Wi-Fi network. This does not tell you if Wi-Fi is turned on or off but rather if the device is joined to a Wi-Fi network or not. Perhaps this is sufficient for your purposes.
Also note that this API doesn't work in Simulator, as CNCopySupportedInterfaces() always returns NULL.
#include
BOOL hasWiFiNetwork = NO;
NSArray *interfaces = CFBridgingRelease(CNCopySupportedInterfaces());
for (NSString *interface in interfaces) {
NSDictionary *networkInfo = CFBridgingRelease(CNCopyCurrentNetworkInfo((__bridge CFStringRef)(interface)));
if (networkInfo != NULL) {
hasWiFiNetwork = YES;
break;
}
}