How long does Apple Watch keep HealthKit data?

I would like to create an Apple Watch only app that queries data such as blood oxygenation, heart varibility, number of steps, energy consumed, and other data of a similar nature recorded over the past month and performs calculations on them. I read from the HealthKit documentation that Apple Watch synchronizes data with iPhone and periodically deletes older data, and that I can get the date from which the data is available with earliestPermittedSampleDate(). Is there a risk that in general, by making queries to retrieve data up to a month old, the data will no longer be available? I need the app to work properly without needing an iPhone.

Replies

Sorry, I've had a look and can't find the docs on this but essentially, my understanding is that the Apple Watch holds at least the past 7 days of Health data.

If you had an app running on the Watch you could consider using background execution to cache entries and extend that window.