Post

Replies

Boosts

Views

Activity

Comment on HKAnchoredObjectQuery Stops Receiving Updates
Done! I’ll start testing with this. I changed from HKObserverQuery(queryDescriptors: ...) to HKObserverQuery(sampleType: ...) to only observe changes in steps. However, with HKStatisticsCollectionQueryDescriptor, I fetch: averageHeartRate, steps, durationMinutes, distanceMeters, and activeCalories, because observing with queryDescriptors retrieves samples individually for each metric. Thanks again!
Mar ’25
Comment on BGTaskScheduler with
I switched to HKAnchoredObjectQuery since HealthKit queries require an unlocked device, but the callback stops working after a few updates, preventing POST requests. I’d like to share my full implementation and code. https://github.com/FerFuentes/HealthKitManager/blob/main/Sources/HealthKitManager/Private/Activity/HKMWalkingActivity.swift Thank you in advance for your help! I really appreciate it. Best regards, Fer Fuentes
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’25