2

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.

LOP_Luke
  • 3,150
  • 3
  • 22
  • 25
  • This seems an issue with the latest release v7.1 of watchOS as well. Have you found any workaround? – Mithil Jadhav Nov 20 '20 at 04:06
  • 1
    Our business logic allowed us to change to `HKDevice.local()` on WatchOS. That definitely is not an equivalent query though so it won’t be a viable workaround in all cases. – LOP_Luke Nov 20 '20 at 16:09

0 Answers0