Why isn't Health Connect background sync firing?
Health Connect background sync behaves differently from Apple Health, so schedulerOn=true working immediately is not expected on first connection.
Health Connect background sync behaves differently from Apple Health, so schedulerOn=true working immediately is not expected on first connection.
How the scheduler works:
It is a one-time task, re-enqueued on each
initTerra()call, with an 8-hour gate per data type.On first connection it only marks a timestamp and exits without fetching. The first real auto-sync therefore fires on the next foreground open at least 8 hours after connecting.
Manual
getActivitybypasses the gate, which is why it works straight away.
Also set both your app and the Health Connect app to Unrestricted battery usage, since Samsung Device Care silently kills background tasks placed in sleeping apps.
Last updated
Was this helpful?