> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/faq/help-topics/data-api-sdk/webhooks-dedup-and-sync-reliability/apple-sdk-sync-timing-foreground-dependent.md).

# Can Apple Health data arrive near real-time?

Apple Health sync timing is **controlled by iOS**, which decides when to release resources to deliver new data, so true real-time delivery cannot be guaranteed.

Once [background delivery](https://docs.tryterra.co/health-and-fitness-api/mobile-only-sources/ios-swift) is set up (`Terra.setUpBackgroundDelivery()` in your `AppDelegate`), HealthKit data is sent to your destination automatically, including in the background. The documented behaviour is:

* It only triggers when the **phone is unlocked**.
* It only triggers when there is a **network connection**.
* It still triggers when the **app is killed**, but at a **much lower frequency**.
* Only **enabled data types** (from the Terra Dashboard) are delivered.

If data originates from another app feeding Apple Health, that source app has to write into HealthKit first before Terra can read it. Because iOS schedules delivery itself, data can arrive late, and one data type updating does not necessarily trigger another.

The dashboard **backfill button** queues a fetch that runs when the app next has an active session, so initial-sync data marked `Backfill` is expected SDK behaviour. Opening the app regularly tends to make iOS schedule deliveries sooner, as the system learns the usage pattern.
