After a telemetry opt-out, MapboxCommon still starts its own CLLocationManager, with significant-change monitoring and background updates enabled

Abierto
#2,460 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
18/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
ios, swift
Área
mobile

Línea de trabajo

Start with the attached MapboxLocationRepro.zip and its five logs, then find where MBXCLDeviceLocationProvider is created and where MGLMapboxMetricsEnabled is read, to see whether the opt-out flag reaches the location provider. Run the repro under the telemetry-off launch and confirm the startUpdatingLocation, significant-change and background calls still appear. Done means the SDK starts no Core Location service after opt-out, or the guide's wording is corrected; the design choice between the two is for maintainers to settle.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

auto-triaged bug :beetle: p1

Environment

  • Xcode version: 27.2 (27B48)
  • iOS version: 27.2 (simulator, the attached sample); 26.7.3 (iPhone 13 Pro, our app)
  • Devices affected: iOS 27.2 simulator; iPhone 13 Pro
  • Maps SDK Version: 11.35.1 (MapboxCommon 24.35.1)

Observed behavior and steps to reproduce

Minimal reproduction (attached, MapboxLocationRepro.zip). A SwiftUI app whose only content is a full-screen Map(). It creates no CLLocationManager and calls no Core Location API; it has the location background mode, and location permission is granted with simctl privacy. A logger records every start and stop call made on any CLLocationManager, with the class of the manager's delegate and the manager's settings. It passes each call through unchanged and logs no coordinates.

In every launch, within two seconds, a manager whose delegate is MBXCLDeviceLocationProvider receives:

  • startUpdatingLocation (3 to 8 calls), with desiredAccuracy 999 and no distance filter
  • startMonitoringSignificantLocationChanges (1 or 2 calls)
  • setAllowsBackgroundLocationUpdates: with true

With telemetry opted out the calls are the same. Opted out here means MGLMapboxMetricsEnabled set to false in UserDefaults before any Mapbox object exists, which is the key the attribution menu's telemetry switch writes. Five launches in all: fresh install and relaunch, telemetry at its default and off, including a relaunch with the key already false before the process started. The steps and the five logs are in the zip.

On a device, in our own app (iPhone 13 Pro, iOS 26.7.3; the app uses none of the SDK's location features and records location itself with its own manager and Always authorisation), with telemetry opted out, two launches:

  • startUpdatingLocation and startMonitoringSignificantLocationChanges at launch, allowsBackgroundLocationUpdates reading true from then on, and no region registered.
  • Launch A: 9 minutes after the app went to the background the SDK's delegate was still receiving 60 locations a minute, when we stopped watching.
  • Launch B: stopUpdatingLocation came 5 minutes after backgrounding. An hour after launch allowsBackgroundLocationUpdates was still true.

With telemetry on, on a fresh install of the same app, the SDK's delegate received 753 locations in the background in the 15 minutes before its stopUpdatingLocation.

Expected behavior

  • After the user opts out of telemetry, the SDK starts no Core Location service of its own: no location updates, no significant-change monitoring, no background updates. The privacy policy says that after an opt-out "Mapbox will only receive location data in response to an end user's actions".
  • The iOS guide says: "By default, the SDK sends de-identified location and usage data to Mapbox whenever the host app causes it to be gathered." Here the host app asks the SDK for no location, and the SDK gathers with a manager of its own. Either the behaviour or that sentence needs correcting.

Notes / preliminary analysis

  • #2230 was closed in 2024 with "A developer could not turn it off." This report is about what the SDK does after the user has turned telemetry off, and about the guide's wording.
  • #2335 (open) asks for the same thing underneath: a supported way to stop the SDK's own location manager. For an app that supplies its own location, a public way to hand the SDK a location provider, or none, would resolve it.
  • The SDK's manager runs with no distance filter in every case above.
  • We have not measured what, if anything, is uploaded in any of these states.

Additional links and references

MapboxLocationRepro.zip

Lenguaje dominante
Swift
Estrellas
601
Forks
198
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mapbox/mapbox-maps-ios

Todos los issues de mapbox/mapbox-maps-ios

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.