Home > Software engineering >  CoreLocation - visits monitoring
CoreLocation - visits monitoring

Time:12-22

I am facing issues when using visits monitoring service of coreLocation. When I use visits monitoring, the location update is inconsistent. What exactly is considered as a visit in corelocation?

This is how I start visits monitoring

self.manager.startMonitoringVisits()

I also have added all the CLLocationManagerDelegates.

CodePudding user response:

The documentation is quite ambiguous about what a visit is defined as. As reported by this article

lines get blurred at the edges of what is and what is not a visit. Ducking into a corner coffee shop for a minute might not trigger a visit, but waiting at a particularly long traffic light might. It’s likely that Apple will improve the quality of visit detection in future OS upgrades, but for now you might want to hold off on relying on CLVisit in favor of your own visit detection for use cases where it’s vital your data is as accurate as it can be.

CLVisit has a lot of shortcomings ranging from arrivalDate accuracy to horizontalAccuracy precision. Instead of relying on CLVisit, try using the Significant Location Change Service

CodePudding user response:

I have an app in the store that uses visit tracking.

I find visit monitoring is pretty accurate. I have never had it detect a red light as a visit, for example. Comparing the reported visit times against an actual record of where I was is also pretty accurate.

The only real inaccuracy I have seen is the actual GPS coordinates and that is more a factor of being indoors or in an inner city area where gps accuracy is reduced.

While Apple does not document how their algorithm works, I suspect that they uses more than just GPS when determining visits; Is the device connected to a car kit? what type of motion occurred prior to and after the "stop" (If motion is smooth and fast before and after you are probably in a vehicle).

One thing to be aware of with visit tracking is that you can receive an initial CLVisit with just an arrival date and then later get an update with the arrival and departure dates filled in.

You can also expect some latency between when you arrive at a location and when you get the initial CLVisit to your delegate, but the arrival date is "back dated" to when iOS determined that the visit started.

  • Related