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.
In general, Apple Watch keeps HealthKit data for about a week. For some data types, the retention time can be longer, and so you might see the data is still there after a week. We don't have a complete list about the retention time of those data types to share. You might consider doing your own testing on the data types you are interested in, if you need the information.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.