You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to write an ExerciseSession record without an ExerciseRoute, you get the error:
Caller doesn't have android.permission.health.WRITE_EXERCISE_ROUTE to write to record type class android.health.connect.datatypes.ExerciseSessionRecord]
But I think you should be able to write an ExerciseSession record that doesn't have a route, like a weight lifting session will have an ExerciseSession but no ExerciseRoute and no required permissions for ExerciseRoute.
I think line 47 should default to undefined instead of an empty list:
I've never written Kotlin code but if you can confirm that all I need to do is set that line to default to undefined I'm happy to make a pull request.
You can can recreate the issue by calling insertRecords like below with only ExerciseSession permissions insertRecords([ { recordType: 'ExerciseSession', startTime: startDate.toISOString(), endTime: dateCompleted.toISOString(), exerciseType: ExerciseType.STRENGTH_TRAINING, title: 'Strength Training', }, ])
The text was updated successfully, but these errors were encountered:
If you try to write an ExerciseSession record without an ExerciseRoute, you get the error:
Caller doesn't have android.permission.health.WRITE_EXERCISE_ROUTE to write to record type class android.health.connect.datatypes.ExerciseSessionRecord]
But I think you should be able to write an ExerciseSession record that doesn't have a route, like a weight lifting session will have an ExerciseSession but no ExerciseRoute and no required permissions for ExerciseRoute.
I think line 47 should default to undefined instead of an empty list:
react-native-health-connect/android/src/main/java/dev/matinzd/healthconnect/records/ReactExerciseSessionRecord.kt
Lines 21 to 47 in 3784cc3
I've never written Kotlin code but if you can confirm that all I need to do is set that line to default to undefined I'm happy to make a pull request.
You can can recreate the issue by calling insertRecords like below with only ExerciseSession permissions
insertRecords([ { recordType: 'ExerciseSession', startTime: startDate.toISOString(), endTime: dateCompleted.toISOString(), exerciseType: ExerciseType.STRENGTH_TRAINING, title: 'Strength Training', }, ])
The text was updated successfully, but these errors were encountered: