I am working on a duress app and would like to improve location accuracy by encouraging users to enable Wi-Fi. In Apple Maps, I noticed that when Wi-Fi is off, a dialog prompts users to turn on Wi-Fi to enhance location accuracy. I am looking to implement similar functionality in my app. Specifically, I would like to check whether Wi-Fi is enabled on the user's device (even if it is not connected to a network). Despite exploring several methods, I have been unable to determine a reliable way to check the Wi-Fi status. Can you guide me on whether it is possible to access this functionality in iOS, and if so, how I can implement it within my app?
Speaking from a networking perspective, iOS has no API that answers the question “Is Wi-Fi on or off?” If you try to infer this state from other APIs, you’ll inevitably run into weird problems (something you seem to have discovered already).
For a summary of what Wi-Fi APIs are available are available on iOS, see TN3111 iOS Wi-Fi API overview.
There may be more answers to this in the Core Location space, but that’s not my area of expertise and so I’ll leave others to comment on that.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"