Post

Replies

Boosts

Views

Activity

Health kit - Get shared health data along with my health data
I can able to get my health data list from health kit. I used below code to get my today's step count : `func getTodaysSteps(completion: @escaping (Double) -> Void) { let stepsQuantityType = HKQuantityType.quantityType(forIdentifier: .stepCount)! let now = Date() let startOfDay = Calendar.current.startOfDay(for: now) let predicate = HKQuery.predicateForSamples( withStart: startOfDay, end: now, options: .strictStartDate ) let query = HKStatisticsQuery( quantityType: stepsQuantityType, quantitySamplePredicate: predicate, options: .cumulativeSum ) { _, result, _ in guard let result = result, let sum = result.sumQuantity() else { completion(0.0) return } completion(sum.doubleValue(for: HKUnit.count())) } healthStore.execute(query) }` But i have one more health data of my brother, where he invited me to see his health data in my real device. Now i was not able to read / get his health data. Is there any way to get that. Any solution would be great ...!
4
0
1k
Apr ’22