Health Manager
Functions
Link copied to clipboard
abstract suspend fun enableBackgroundDelivery(types: List<HealthDataType>, frequency: HealthUpdateFrequency = HealthUpdateFrequency.Immediate): Result<Unit>
Enable background delivery for the specified types. On iOS, this calls HKHealthStore.enableBackgroundDeliveryForType.
Link copied to clipboard
Link copied to clipboard
abstract suspend fun isAuthorized(readTypes: List<HealthDataType>, writeTypes: List<HealthDataType>): Result<Boolean>
Link copied to clipboard
Link copied to clipboard
Check if background delivery for health data is active.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun observeUpdates(types: List<HealthDataType>, callback: (HealthDataType) -> Unit): Result<Unit>
Observe updates for the specified types. On iOS, this sets up an HKObserverQuery. The callback is invoked when new data is available. The callback should trigger a data read and sync.
Link copied to clipboard
Link copied to clipboard
abstract suspend fun readData(startTime: Instant, endTime: Instant, type: HealthDataType): Result<List<HealthRecord>>
Link copied to clipboard
abstract suspend fun requestAuthorization(readTypes: List<HealthDataType>, writeTypes: List<HealthDataType>): Result<Boolean>
Link copied to clipboard