Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getWorkoutRouteSamples fails to retrieve complete route for activities with intervals #397

Open
maethub opened this issue Nov 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@maethub
Copy link

maethub commented Nov 4, 2024

Describe the bug
Apple introduced WorkoutKit (https://developer.apple.com/documentation/workoutkit) in iOS 17 to allow users to have pre-programmed workouts (e.g. intervals for running) on their Apple Watch Fitness app. Since this is released, we see that activities using intervals fail to be transmitted completely to our app using react-native-health. The workout route is either not available or only in parts. After some investigation and debugging, we found the attached (screenshot) error:

Illegal callback invocation from native module. This callback type only permits a single invocation from native code.

[...]

__64-[RCTAppleHealthKit(Methods_Workout) workout_getRoute:callback:]_block_invoke_2

__82-[RCTAppleHealthKit(Queries) fetchWorkoutRoute:predicate:anchor:limit:completion:]_block_invoke_2

[...]

To Reproduce
Steps to reproduce the behavior:

  1. Record a running activity with intervals (Outdoor Run > Custom)
  2. Sync data from HealthKit using getAnchoredWorkouts and getWorkoutRouteSamples in Debug Mode
  3. Error occurs and/or route data returned is not complete

Expected behavior
This behavior does not occur for workouts not using any pre-programmed intervals (e.g. Outdoor Run, Open Goal). It is expected that the intervals do not change how the route data is received

Screenshots
Screenshot 2024-11-04 at 14 25 04

Smartphone:

  • Device: iPhone 11 & Apple Watch Series 7
  • OS: iOS 18.1 & WatchOS 11
  • Version 1.18.0

Additional context
The workout shows complete data when looking at it in the iOS Fitness app.

@maethub maethub added the bug Something isn't working label Nov 4, 2024
@SerranoPablo
Copy link

I have a similar issue where I get gaps in workoutRoute data. This only happens when it is a structured workout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants