HKAuthorizationStatus for HKWorkoutRouteTypeIdentifier Always Returning .notDetermined After Granting Access
I am using HKHealthStore to request authorization for both HKWorkoutTypeIdentifier and HKWorkoutRouteTypeIdentifier. After the authorization is granted, I am trying to check the authorization status using authorizationStatus(for:), but it always returns HKAuthorizationStatus(rawValue: 0) (which corresponds to .notDetermined). Despite successfully granting access, the status does not reflect the change.
Here’s the code I’m using:
HKAuthorizationStatus for HKWorkoutRouteTypeIdentifier Always Returning .notDetermined After Granting Access
I am using HKHealthStore to request authorization for both HKWorkoutTypeIdentifier and HKWorkoutRouteTypeIdentifier. After the authorization is granted, I am trying to check the authorization status using authorizationStatus(for:), but it always returns HKAuthorizationStatus(rawValue: 0) (which corresponds to .notDetermined). Despite successfully granting access, the status does not reflect the change.
Here’s the code I’m using:
In Apple Healthkit, Workout totalEnergyBurned is deprecated but active energy returns null
I am trying to get the total calories burned for a workout. In the below example, deprecatedCalories
which uses sample.totalEnergyBurned
returns the correct number of calories, but it tells me that it is deprecated and I should use .statistics
to retrieve information about the workout instead. So I did that with the calories
variable.
Retrieve a Data from HealthKit
I am working on an application related to Heart Rate Variability. To complete a step, I need the data that can be found in “Heart Rate Interval Measurements” located in HealthKit by pressing on the value returned in the variability section (the specific value is SDNN). The data I would like are those in the photo. Is it possible to retrieve them using Swift? I have been trying for a week without results.