enable Background Delivery
Enables platform-specific background delivery of health data.
iOS/watchOS: Registers an
HKObserverQueryfor step-count data and enables HealthKit background delivery (approximately hourly).Android: Schedules a periodic WorkManager sync (approximately every hour).
Parameters
Optional callback invoked when new health data becomes available (e.g. when an HKObserverQuery fires on iOS). On Android, the WorkManager worker calls syncSteps() directly, so this callback is not used.
Enables HealthKit background delivery for step-count data.
When enabled, iOS will wake the app periodically (approximately hourly) when new step data is written to HealthKit.
Prerequisites:
com.apple.developer.healthkit.background-deliveryentitlementUIBackgroundModesincludesfetchin Info.plistHealthKit permissions must already be granted
Call disableBackgroundDelivery to stop.
Enables HealthKit background delivery for step-count data.
When enabled, watchOS will wake the app periodically (approximately hourly) when new step data is written to HealthKit. Each wake-up emits a Unit on healthDataUpdates.
Call disableBackgroundDelivery to stop.