IOS - Geofencing with WiFi Off

I have code that creates a geo object on my iPhone that will run some code that will execute when didExitRegion is called. However, I found that when my WiFi is off, didExitRegion never starts. Is WiFi required to monitor region changes in iOS? My desired accuracy is kCLLocationAccuracyHundredMeters. I am testing iOS 6.1 and iPhone 4.

Here is my code for setting location control:

- (id)init { self = [super init]; if (self) { CLLocationManager *manager = [[CLLocationManager alloc] init]; manager.delegate = self; manager.desiredAccuracy = kCLLocationAccuracyHundredMeters; manager.distanceFilter = RADIUS/10.0; manager.headingFilter = kCLHeadingFilterNone; self.locationManager = manager; self.authorizationStatus = [CLLocationManager authorizationStatus]; } return self; } 

thanks

+6
source share
3 answers

iOS devices use three methods to locate a user. From (usually) the most accurate to the least accurate:

  • GPS hardware
  • Detecting nearby Wi-Fi networks
  • Cell tower triangulation

If your application does not use GPS or does not work (that is, it was previously completed), the device will try to use methods 2 and 3 above to find the user. Thus, the ability of a device to find a user (when GPS hardware is not used or there is a weak GPS signal) depends on the availability of Wi-Fi networks and cell towers. The more Wi-Fi networks and cells, the better the accuracy of the location. Therefore, when a user enters or leaves a controlled area (for example, crosses a "geofence"), it is impossible to accurately predict when a user will receive a notification, if at all. (Of course, if the area in question is always the same, the device will more or less localize the user with the same degree of accuracy in each case).

Here's the relevant documentation from Location Programming Guide by location :

Certain threshold distances are determined by the equipment and location technologies that are currently available. For example, if Wi-Fi is disabled, area monitoring is much less accurate. However, for testing purposes, you can assume that the minimum distance is about 200 meters.

Thus, Wi-Fi is not required for monitoring the region, but when it is turned on, your device will have a better chance of determining whether the user has crossed the geofence of the region.

+11
source

If you turn off WiFi, location accuracy will be reduced. If you do not have a GPS signal (inside some buildings), you will not receive any location updates. Have you tried this when you are outside, or if you used a location simulator for testing?

In addition, WiFI is not required for the geofence function if you have GPS (iPhone or iPad with sims).

+2
source

Strange weird things can happen without using wifi using the main location. To help in your case, I will get rid of the distance filter, which can ruin things, and this is not very useful. I would probably only use kCLLocationAccuracyBest for anything where I need the accuracy needed to adjust the geofence. Using other precision and filters for me, sometimes through the counter gps flies out for 1000 meters and takes a minute or two to fix itself. If it is a battery that is too large, then set up a system in which it turns off and on depending on how far it is from the fence.

+2
source

All Articles