CLVisit behaving differently since iOS 11.3

I have been working with CLVisits, and since the 11.3 update, a lot more Visit events are being generated which have no

arrivalDate
field. Normally, a first Visit event will be generated just with
arrivalDate
followed by a second one with both
arrivalDate
and
departureDate
(
arrivalDate
being the same as the previous event). Essentially, these second ones are missing very frequently now following 11.3.

Has anyone else noticed this change of behaviour and would know how to explain it?

I also don't know why they were happening in the first place, if anyone has an answer to that it would be great.

Replies

Would like to understand more about this.


First, are you seeing these in your own tests, or are you collecting data from your users and seeing more of this? If you are collecting user data do you have any idea about the conditions that cause this? Are they in tunnels, just flew across time zones, the phone was powered off for some time, etc.?


To help me understand what exactly is missing:

- do you see the first record with arrival time, then the second one with no arrival date, but containing departure date?

- do you see the first record with no arrival date?

- or do you see no arrival record at all, but only a departure record with departure date, but no arrival date?


All of these could have explanations, but would require to know the exact conditions these are happening.

Thank you very much for your quick answer.


So we are collecting data from our own tests and from users.

In the past (i.e. before 11.3), we suspected that those "missing" visit events were indeed because of tunnels, flights (as in flight mode activated), phone powered off or low on battery.

As of 11.3, they happen much more often for no reason we can think of (from once every week or so to up to several times per day).


Let me give a clear summary:

We almost always have the `arrivalDate`, be it with or without a `departureDate`.

We almost never have just the `departureDate` (1/2000).

However, we now notice that way more often (in version 11.3 compared to before) we just have the `arrivalDate` alone and no corresponding visit event with the same `arrivalDate` and a `departureDate`. Therefore, we have no clue of what the user is doing between this time and the next visit event.

We also notice some "overlapping visits".

If you only consider the visit events with both an `arrivalDate` and a `departureDate`, then there shouldn't be 2 of them hapenning at the same time. However, we now have noticed some. They are always happening at almost exactly the same location so it's not really difficult to handle, but still we have to handle it.

Exactly the same problem has come from 11.3.

My users are very confused.

Is it change of specification of CLVist, is it just a bug?

On the few samples we have with version 11.4, the situation didnt seem to evolve.

I'm having the exact same problem:


  • I get arrival events no problem (arrival time is as expected, with distant-future as the departure time). This is normal. 🙂
  • In some cases there is no departure event time for the same visit. So the visit is not complete, it only has an arrival time. This is not normal. 😟
  • This API is extremely difficult to troubleshoot since you can't create visits in the simulator. But I think that it's either because:
    • There are multiple visits coming into the "didVisit" event handler at the same time. I can't figure out if this is true or how to code for this scenario.
    • The location manager is being created on the background thread (when the app is launched from the background) and causing the app to crash.
  • I noticed most of the time I get the problem when the app has been in the background for a while (and then launched from the background automatically) or when I visit several places in a very short period of time.
  • I also sometimes see the double visit issue (where I see the same exact visit data repeated twice). I think this is related to the phone rebooting or being updated. Not sure though.


Hope this helps. Please let me know. I've been struggling with this for a long time. Thanks!

We will definitely look into the fact that the app is running for a long time in the background and see how that affects visits.


We also have what we call "overlapping" visits (what you call double visits). And the problems might indeed be related.


However our app is not crashing so I would say that your location manager issue is maybe different. We are definitely going to try to find a way to test the scenario you are talking about.


Will let you know, thanks for the feedback!