Questions tagged [hkobserverquery]

20 questions
0
votes
1 answer

HealthKit HKObserverQuery that calls HKAnchoredObjectQuery Not Running Result Handler in Background

I have looked through so much Apple documentation and SO questions but still can't figure out why or even if this should work. I have a long running HKObserverQuery, I set this up in my AppDelegate and I have all the required permissions,…
jmichas
  • 1,139
  • 1
  • 10
  • 21
0
votes
1 answer

HealthKit HKObserverQuery not firing consistently

I am building an app which is supposed to listen to changes in HealthKit regarding newly added heart rate data using HKObserverQuery but weirdly the observer's updateHandler block doesn't fire consistently when I debug using breakpoints and console…
Tomer Ciucran
  • 199
  • 1
  • 10
0
votes
0 answers

iOS pass parameter swift 3

Hi I want to simplify my code so I put in following way private func heightChangedHandler(query: HKObserverQuery!, completionHandler: HKObserverQueryCompletionHandler!, error: Error!) { // Here you need to call a function to query the height…
e.k
  • 1,333
  • 1
  • 17
  • 36
0
votes
2 answers

HKObserverQuery background delivery stops working after calling completionHandler

So according to Apple, I need to call the HKObserverQueryCompletionHandler after the updateHandler is triggered from data being added to HK. But as soon as I call the completionHandler, the observer query stops giving any more updates in the…
Tomer Ciucran
  • 199
  • 1
  • 10
0
votes
1 answer

HealthKit not returning updated info

I have been trying to query HealthKit for the number of steps on my phone. Here is what I have tried: let endDate = NSDate() let startDate = NSCalendar.currentCalendar().dateByAddingUnit(.Day, value: -1, toDate: endDate, options: []) …
Pranav Wadhwa
  • 7,666
  • 6
  • 39
  • 61
1
2