kvs-coder/health_kit_reporter

HKCategoryTypeIdentifier.sleepAnalysis missing

RahulShivkumar opened this issue · 3 comments

Great package! I was wondering if you had plans of including sleep analysis in the supported category types.

Hi @RahulShivkumar

Yes, I am working on it

Thanks, @VictorKachalov! Let me know if I can help in any way.

Another question in observerQuery is it safe to send HTTP queries (say I wanted to send this updated data to my server) or will the handler usually timeout? Apple doesn't seem to have a lot of documentation around the completionHandler for observerQuery

Hi @RahulShivkumar

About sleep analysis please review the library carefully, they are Category types, which were supported in initial versions. So technically HKCategoryTypeIdentifier.sleepAnalysis was initially in the package. Please use sample app. Probably you would be need to extend the dates in the predicate in order to fetch earlier samples.

The observer query itself is just a notifier from Apple Health meaning that smth was changed in the data bank. You can add your custom logic in completeion handlers which I provide

static StreamSubscription<dynamic> observerQuery

You can send http requests with your network layer, you can fetch the data from Health Kit using other pacakge functions, etc.