ATFinke-Productions / Steppy-2

An open-source remake of my step tracking app, Steppy.
https://itunes.apple.com/us/app/steppy-2/id957204397?ls=1&mt=8
MIT License
5 stars 1 forks source link

Refresh from Apple Health total combined steps? #6

Closed osimons closed 9 years ago

osimons commented 9 years ago

In Apple Health I have two sources for steps – the iPhone + a Basis Peak activity tracker watch. Steppy 2 will not update the combined Health step total until after I've opened Health app forcing it to update the new totals. Can Steppy 2 periodically poll Health and force it to update, or is there no such API available? If possible it should at least make this call whenever refreshing the Today widget and App display to get latest numbers.

osimons commented 9 years ago

For the "Today" widget to show correct data, I must now first open Health app for Health to refresh combined steps, and then open Steppy 2 app for it to read latest data from Health. Then at least the data will be correct in widget also – at least until I move again ;-)

atfinke commented 9 years ago

From what I have seen, HealthKit only publishes new data periodically, or when the Health app is opened. This means that if I fetch new data once and then again 10 minutes later, the data Steppy receives is the same even if you have taken more steps.