I saw in some apps that there is an alert saying something like "Location accuracy is improved when Wi-fi is turned on. Go to settings to turn on wifi" and then there are 2 buttons, "cancel" or "settings", in which case it redirects you to the settings page. How do they determine whether wifi is on or off? I am not asking for reachability status since internet connection is not a concern, what i am concerned about is location accuracy and since wifi increases accuracy, i want to know whether it is turned on or not regardless of internet connection via wifi. Thanks in advance!
EDIT:
after seeing comments and answers, I think I need to stress this: I am not looking to find whether there is internet access via WI-FI. Think about the situation where wifi is turned on in settings, but the phone is not connected to any wi-fi network. The difference is when you have location services enabled. Having wifi turned on gives you better location fix indoors, where gps satellites may not be visible (even though you are not connected to any particular wifi network, where isReachableViaWiFi
would return NO
, but actually wifi is on and i am able to get this more accurate location)
Thanks!