hkhealthstore

HealthStore enableBackgroundDelivery when screen is locked

不想你离开。 提交于 2019-11-30 05:44:37
Hello I'm trying to setup the health store observer with background delivery enabled. My problem is that it won't deliver anything when the screen is locked. I have simplified my code for this question to get to the point :) I have HealthKit in my plist and I have accepted healthStore type step count. Everything is fine when the app is open and when the screen is not locked. But when the screen is locked I don't get any observations. For test purpose the frequency is set to immediate. My code is as follows - (void)setupHealthStore{ if ([HKHealthStore isHealthDataAvailable]) { NSSet

HealthKit (iOS) won't deliver data in background (objC)

只谈情不闲聊 提交于 2019-11-28 23:38:57
问题 We're currently trying to get HealthKit to work in the background, in order to deliver steps data to our server when the App is closed. For experimental purposes we've created a brand new iOS project in XCode, enabled HealhtKit and all background modes in Compabilities. After that, we pretty much run the code (see further down). So what happens first is that the app ofcourse asks for the permissions, which we grant. What we're expecting is that the app should keep deliver the steps data every