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

Aperta
#2,460 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ios, swift
Ambito
mobile

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Swift
Stelle
601
Fork
198
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mapbox/mapbox-maps-ios

Tutte le issue di mapbox/mapbox-maps-ios

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.