mergHK (Health Kit) assistance request

Brian Milby brian at milby7.com
Mon Oct 9 09:15:10 EDT 2017


Just wanted to do a quick check to see if anyone is currently using mergHK
successfully with recent releases.  I was able to get the authorization to
work, but every time I attempt a query I get an error like:

"HKSampleSortIdentifierEndDate is not a valid sort key for samples of type
HKQuantityTypeIdentifierAppleExerciseTime"

This is the line of code causing the error:
mergHKSampleQuery kHKType, tStartDate, tEndDate

I've tried with the BMI, Weight, and AppleExerciseTime (if the type is
invalid, the app will just quit when you attempt to get authorization).
I've tried to use HKSampleSortIdentifierStartDate and "" with similar
results.

I've built with 9DP9 and 8.1.7rc1 (I don't have Xcode9 yet, so rc3 won't
build).
I've used setting for IOS 9.3 and 10.0 as build versions.
I'm testing on an IOS11 iPhone 6SPlus
XCode 8.3.3 on Sierra

Any pointers or suggestions?

Thanks,
Brian

P.S.  What I'm really interested in is "HKCategoryValueAppleStandHour", but
that won't even authorize.  Trying to talk to Health Kit first before
moving on to why that type doesn't work.

P.P.S.  The plist files in the LC distribution need to be edited to even
get it to work at all on IOS10+ since there are 2 entries now required (1
for read, 1 for write).



More information about the use-livecode mailing list