HealthKitDiagnostics

data class HealthKitDiagnostics(val isHealthDataAvailable: Boolean, val authorizationRequestStatus: HealthKitAuthRequestStatus, val stepTrackingStatus: HealthPermissionStatus, val osVersion: String, val deviceModel: String, val requestedReadTypes: Set<String>, val stepDataSources: List<HealthKitDataSource> = emptyList())

A snapshot of Apple HealthKit diagnostic information for debugging purposes.

Obtain an instance via AFHealthTracking.getHealthKitDiagnostics() (iOS / watchOS).

Important Apple privacy note: HealthKit does not expose whether the user granted or denied individual read permissions. authorizationRequestStatus only tells you whether the permission dialog has been shown — not the user's actual choices. If the user denied a specific type, your app simply receives no data for that type.

Sample usage (Swift interop / Kotlin):

val diag = AFHealthTracking.getHealthKitDiagnostics()
println(diag)

if (!diag.isHealthDataAvailable) {
// HealthKit is not supported on this device (e.g., iPad)
}
if (diag.authorizationRequestStatus == HealthKitAuthRequestStatus.SHOULD_REQUEST) {
AFHealthTracking.requestPermissions(null)
}

Constructors

Link copied to clipboard
constructor(isHealthDataAvailable: Boolean, authorizationRequestStatus: HealthKitAuthRequestStatus, stepTrackingStatus: HealthPermissionStatus, osVersion: String, deviceModel: String, requestedReadTypes: Set<String>, stepDataSources: List<HealthKitDataSource> = emptyList())

Properties

Link copied to clipboard

Whether the authorization dialog has already been presented to the user.

Link copied to clipboard

Device model string (e.g. "iPhone", "Apple Watch").

Link copied to clipboard

Whether HealthKit is available on this device (HKHealthStore.isHealthDataAvailable).

Link copied to clipboard

OS version string (e.g. "17.4.1").

Link copied to clipboard

Human-readable names of the HealthKit data types requested for reading.

Link copied to clipboard

Apps and devices that have contributed step-count data to HealthKit.

Link copied to clipboard

Inferred step-tracking read-permission status based on a data-query probe.

Functions

Link copied to clipboard
open override fun toString(): String