8

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!

akaralar
  • 1,103
  • 1
  • 10
  • 29
  • http://stackoverflow.com/questions/1861656/iphone-reachability-checking – Konrad77 Aug 06 '13 at 12:29
  • http://stackoverflow.com/questions/2401987/network-reachability-on-iphone – Rushabh Aug 06 '13 at 12:31
  • 1
    @Konrad77 thanks for the link but the question is not about whether iphone is able to reach the internet via wi-fi. It may not have internet access via wifi but this does not mean it is not using wifi sensors to give you an accurate location (not connected to any wifi network, but wifi is on). Thanks though – akaralar Aug 06 '13 at 12:48
  • @Rushabh see above comment – akaralar Aug 06 '13 at 12:54
  • @ParthBhatt thanks, i searched for a question like this but was unable to find it – akaralar Aug 06 '13 at 12:55
  • Was trying to do the same: http://stackoverflow.com/a/26238866/367677 – Asahi Dec 31 '14 at 08:58
  • 3
    I dont know why everyone marks questions like these as dulplicate of others. This is a totally new question which is asking about Wifi On/Off status not reachability via Wifi/3G/BluetoothPAN. Please read questions before marking duplicates. – ShayanK May 26 '16 at 16:57

1 Answers1

0

These 3 methods you can find out in Reachability class for checking internet access..

-(BOOL)isReachable;
-(BOOL)isReachableViaWWAN;
-(BOOL)isReachableViaWiFi;
SachinVsSachin
  • 6,401
  • 3
  • 33
  • 39
  • 1
    thanks, but i have said that i do not care about internet access, there are _**lots**_ of answers related to internet access on SO. and still this answer gets an upvote.. – akaralar Aug 06 '13 at 12:57
  • 1
    whether wifi radio is on, not whether it is connected to any particular wifi network. – akaralar Aug 06 '13 at 13:00
  • @akaralar, so you mean the wifi switch status in system setting? As far as I know, you can not get that unless jailbreak. Please let me know if you do find a way – LiangWang Jun 17 '14 at 00:47