When querying the data, we do not receive a response, and the code enters an infinite loading state without completing the request. Assuming that you meant your initialResultsHandler was never triggered after your query was executed (healthStore.execute(query)), I believe that's a HealthKit bug because, in any case, HKStatisticsCollectionQuery should call the initial results handler after a period of time; if there is an error, it should call the handler with the error. I’d hence suggest that you file a feedback report with a sysdiagnose and share your report ID here for folks to track. For the instructions of how to capture a sysdiagnose, see here. I don't see anything that can work around the issue, but for debugging purpose, I am guessing that the issue may be related to the dataset on the device's HealthKit store. You might check if the following is relevant: The anchor date components. I see that you set anchorComponents.hour to 0. I'd expect that the other components, such as anchorComponents.minute and
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags: