Hello Apple Developer Support / Community,
I would like clarification regarding HealthKit observer behavior when comparing a Flutter-based iOS app with a fully native iOS app.
We are using HealthKit background delivery with:
- HKObserverQuery
- enableBackgroundDelivery
- HKAnchoredObjectQuery
We have observed that in a Flutter-based app, HKObserverQuery callbacks appear to execute multiple times or more frequently than expected for a single data update. In comparison, a native iOS implementation using similar HealthKit logic appears more stable and predictable.
We would like to understand the expected platform behavior and whether there are any known considerations from Apple’s perspective.
Specific questions:
- Does iOS treat HealthKit observer delivery differently for apps built with Flutter versus fully native UIKit / Swift apps?
- Are there known issues where app lifecycle handling, Flutter engine initialization, method channels, isolates, or plugin architecture could cause repeated observer callbacks?
- Can repeated HKObserverQuery executions occur if queries are registered multiple times during app launches or engine restarts?
- Does Apple recommend any specific observer management pattern for cross-platform frameworks such as Flutter?
- From the HealthKit system side, should observer callback frequency be identical regardless of whether the app is Flutter or native, assuming the same iOS code is used?
We are trying to determine whether this behavior is due to HealthKit delivery semantics, duplicate observer registration, Flutter lifecycle integration, or framework-related limitations.
Any guidance from Apple or developers who have implemented HealthKit successfully in Flutter would be appreciated.
Thank you.
I know very little about Flutter and can't comment on that, but would like to be clear that, when using HKObserverQuery + enableBackgroundDelivery, the update handler of HKObserverQuery should be triggered when the device's Health store data it's observing changes. If the app is suspended at that time and has background execution budget, the system should wake it up and run the update handler. Whether the app is built with Flutter or not doesn't matter to HealthKit.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.