New always-on altimeter should expose historical altitude data to developers

So the new Apple Watch Series 6 and SE models tout an always-on altimeter to give more real-time data to users.

I develop a fitness application and see many use cases where having access to 'historical altitude data' would be great! I added elevation gain/loss in a feature update earlier this year and used the HKMetadata keys to attribute my workout and segments with that elevation data.

Access to historical elevation would enable a ton of new features for developers. Preemptively, I have already created a Feedback item outlining my main use case but in summary, but the gist is that I suggested an API on CMAltimeter to be able to query that historical data the same way as on the CMPedometer class.

Reference: https://developer.apple.com/documentation/coremotion/cmpedometer/1613946-querypedometerdata

From that, this is my proposed API:

Code Block
public extension CMAltimeter {
func queryAltimeterData(from: Date, to: Date, withHandler: @escaping CMAltimeterHandler) { }
}


The new consumer feature wasn't advertised as 'always-on and always recording to a file', but under the hood it might already be doing this, or could be doing this.

If you have other ideas and are willing to share in here great. Otherwise submit your feedback, feel free to reference my Feedback item if you're also interested in a new historical query for Apple Watch (or iPhone/iPad too). FB8715215
New always-on altimeter should expose historical altitude data to developers
 
 
Q