Mapbox GL Native telemetry
I finally closed the loop on a long-standing problem we have had with our Wanderings location tracker. We wrote our code to be very low impact; it uses the Significant Location Changes API on iOS to track your movements in a very passive way. But our app was causing the phone to use as much as 100 MBytes/day when running in the background! All that bandwidth was accounted to “Time & Location” in iOS itself, not our app.
Much sleuthing later we narrowed the problem down to Mapbox Metrics, their telemetry service. You can see some discussion in this bug report, but the behavior is expected, not a bug. And somewhat unique to our app. If we turn off telemetry our usage goes down to < 1MB / day of data.
By default telemetry is turned on if you use Mapbox native in your app. And it listens to location updates your app gets. If your app gets a notification the person has moved, Mapbox then requests fine grained location updates for a short period of time. (5 meter movements for 5 minutes, I believe.)
There’s nothing nefarious or dumb here. The location telemetry is a disclosed part of the product and the code is open source. They have appropriate privacy protections. And it’s a reasonable form of telemetry for most apps. I imagine most Mapbox apps have the map front and center as part of the UI with location tracking already enabled, so Mapbox’s telemetry requests don’t really generate any more traffic. Unfortunately our app is just unusual in wanting low impact background updates only, not a good match for the telemetry behavior. Fortunately our users can turn off the telemetry tracking if they want. (In fact, Mapbox requires that apps provide a telemetry opt-out option for users.)
The other confusing piece of this is why does location tracking use so much network bandwidth, and why is it attributed to iOS itself and not our app? Only Apple really knows, but I have some guesses. Phones almost never use an honest GPS signal to track location; mostly location is tracked by reference to nearby Wifi and cellular signals. My guess is every time the phone wants to know its position the iOS location daemon itself makes a TCP/IP request to some Apple server to do a lookup. (I’ve definitely noticed that my location tracking goes way worse when I have cellular data turned off, say when traveling in Europe.) That data usage is significant if you are tracking location in a fine-grained way. And since the request comes from iOS and not the app, the bandwidth is accounted to iOS itself.
While I’m guessing, I think in practice “significant location change” means “moved into range of a new cell tower”. My guess is those location updates come “for free” because the cellular chip already has to do a bunch of work for tower handoffs. Based on observation, moving in range of a new Wifi network is not enough to trigger the location update.