CMAltimeter absolute altitude delivery BROKEN (super slow & inaccurate)

  • Reproducible on iOS 17.4.1 (maybe before) & iOS 17.5. Maybe iOS 17.4 but I can't test it.
  • NSMotionUsageDescription is correctly set (and has always been)
  • Fitness activity & motion authorization are correctly enabled

The delivery for absolute altitude changes became super slow, and might be inaccurate. The only value I get is exactly the same as the GPS altitude. The accelerometer data does not seem to be taken into account anymore.

This critical bug has broken two apps of mine.

How could I quickly solve this?

Thank you!

PS: code is dead simple

let operationQueue = OperationQueue()
self.altimeter.startAbsoluteAltitudeUpdates(to: operationQueue) { [weak self] (data, error) in
    guard let self = self else { return }
    guard let data else { return }
    DispatchQueue.main.async { // Use this value for display
        self.altitude = Measurement(value: data.altitude, unit: UnitLength.meters)
        /* DEBUG VIEW */
        self.updateDebugView(with: data.altitude)
    }
}

I'm using startRelativeAltitudeUpdates with a barometric reference for altitude and subjectively (tested with iOS 17.5 today) the frequency of updates is the same as it used to be in iOS 16 or 15.

I wonder if you have location accuracy at max and distance filter at min, as you mention slower updates and location based altitude. What if Apple linked startAbsoluteAltitudeUpdates totally to a location data and you have low frequency filter/accuracy on you CLLocationManager?

So I confirm that this became a mess. A device can become uncalibrated, probably when he stays inside for a significant amount of time. The issue is that going outside with clear GPS signal is not a good solution. It might take A LOT of time for the device to recover (my watch, for example, never re-calibrated). If it does, the app using CMAltimeter might enter a weird behavior, due to the delivery of inaccurate events.

I don't know what happened with the latest updates, but I have 2 production apps facing major issues.

CMAltimeter absolute altitude delivery BROKEN (super slow & inaccurate)
 
 
Q