react-native-healthkit icon indicating copy to clipboard operation
react-native-healthkit copied to clipboard

Permission error for getWorkoutRoutes()

Open JordanHe opened this issue 11 months ago • 0 comments

I have noticed a strange issue with the Apple Health permissions for when trying to use the Native.getWorkoutRoutes(currentRun.uuid)

What happens is the user accepts permissions to access "HKWorkoutTypeIdentifier" and "HKWorkoutRouteTypeIdentifier"

the getWorkoutRoutes works for a few days but then it just returns null after that for some users. I have been able to reproduce this on my device as well and when I navigate to Apple Health app and go to the workouts section and scroll to the bottom and view the following permissions: Data Sources and Access Workout Route Data Sources & Access

They are both turned on for my app.

The strange thing is if I unselect the permission and turn it back on again then when I try and call getWorkoutRoutes again it begins to work again. Long term though this isn't really a viable solution to expect the user to turn off and turn on the permission each time so maybe theres an issue with how this function checks the permission as it is already enabled in Apple Health but only works when you toggle it off and on again.

I don't really have any logs to help debug this issue so apologies for that but hopefully that is enough to investigate.

JordanHe avatar Feb 28 '24 04:02 JordanHe