enableBackgroundDelivery

actual suspend fun enableBackgroundDelivery(onDataAvailable: () -> Unit?)
actual suspend fun enableBackgroundDelivery(onDataAvailable: () -> Unit?)

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-delivery entitlement

  • UIBackgroundModes includes fetch in Info.plist

  • HealthKit permissions must already be granted

Call disableBackgroundDelivery to stop.

actual suspend fun enableBackgroundDelivery(onDataAvailable: () -> Unit?)

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.