> 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tryterra.co/faq/help-topics/data-api-sdk/webhooks-dedup-and-sync-reliability/apple-sdk-sync-timing-foreground-dependent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
