In watchOS 6, I was creating an HKQuery
for the my app using:
HKQuery.predicateForObjects(from: HKSource.default())
which when executed, was successfully returning HealthKit data only for my app.
In watchOS 7 when I include this predicate in the query, I get no results upon executing the query. Where the exact same query (with the HKSource.default()
predicate) does return results in watchOS 6.
Note: I do get the expected results in iOS 14, so I am only seeing unexpected results in watchOS.
Is this a watchOS 7 bug? Or has the behavior changed for HKSource
in watchOS 7? I can't find any relevant documentation or bug reporting around HKSource
that would explain this difference.