I’m new in Swift and I need to extract all data related to workouts from HealthKit and use it in JavaScript (I'm making a React Native app), so I made a query but its predicate only pass one workout e.g .cycling, what I need is to get all workouts, even if the user has it or not, let's say: get all workouts recorded (even if they are differents) by the user in a list.
I need: Running {...} Cycling {....} Pilates {...}
but I'm getting : Cycling 1 Cycling 2 Cycling 3
In brief, I need a predicate to do this. my code:
CodePudding user response:
You should be passing a nil predicate to the HKSampleQuery
to retrieve all workouts regardless of their type.