1

The speed property of CLLocation that gets returned in the CLLocationManager's didUpdateLocations method seems to be higher on some car models when CarPlay gets connected.

This doesn't seem related to CarPlay Navigation support in the app, as a demo-project can reproduce the issue without CarPlay support.

The specific car models where this is confirmed to occur are:

  • Volvo XC90
  • Ford transit with Sync 3
  • Renault Megane IV model 2018 with Rlink2 and latest firmware
  • Opel Astra station (2018)
  • Ford Focus 2017
  • Opel Astra (model K, 2017) — Gets half of GPS speed

An example of the difference:

  • Car Speedometer: 120km/h
  • GPS Speed from didUpdateLocations: 115km/h
  • GPS Speed from didUpdateLocations with CarPlay connected on one of those car models: 130km/h

Here you can find a demo-project (using NL locale) that reproduces the issue: https://github.com/flitsmeister/carplay-speed-problem

Relevant part:

override private init() {
    super.init()

    // These settings mimick the settings we have in our production app
    locationManager.requestAlwaysAuthorization()
    locationManager.delegate = self
    locationManager.allowsBackgroundLocationUpdates = true
    locationManager.activityType = .automotiveNavigation
    locationManager.pausesLocationUpdatesAutomatically = false
    locationManager.desiredAccuracy = kCLLocationAccuracyBest
    locationManager.distanceFilter = kCLDistanceFilterNone
}

func startLocating() {
    locationManager.startUpdatingLocation()
}

func stopLocating() {
    locationManager.stopUpdatingLocation()
}

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
    guard lastLocation = locations.first else {
        return
    }

    print(lastLocation.speed) // This property is higher when connected to CarPlay
}
Thermometer
  • 2,567
  • 3
  • 20
  • 41

0 Answers0