When reading Healthkit data from an Independent App, some critical properties (Weight, Height) can only be read if there are recent(14 days) datapoints.

Originator:campbell
Number:rdar://7442937 Date Originated:11/12/2019
Status:Open Resolved:No
Product:WatchOS Product Version:6.1
Classification: Reproducible:Yes
 
In a bid to get the smoothest onboarding possible for our fitness watch app, once the user gives us access to read from Health we are prepopulating their profile with their biometrics. Specifically, we use birthdate, height, weight, sex, resting HR. most read fine so long as Healthkit has data for them, but the weight (bodymass) and height only read is there has been a datapoint added in the past two weeks. Any longer than that, and I get a null value. If I open Health on the iPhone and manually add a new datapoint for height or weight, I can then access these properties again for the next 14 days. (See attached video)

We are accessing this with the following lines:
let height = HKObjectType.quantityType(forIdentifier: .height)!  
let weight = HKObjectType.quantityType(forIdentifier: .bodyMass)!  
 
Birthdate and Sex work without issue. If another app writes new data for weight and height, we also have no issue, for the next 14 days at least. 

I have heard from other developers that this has been a long-standing issue, and normally the way around it is to use the companion app to query the data, and pass it back to the watch with Watch Connectivity API. However, this is not an option for us with an Independent App.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!