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

Empty exercise route #127

Closed
gabrielgouv opened this issue Aug 1, 2024 · 0 comments · Fixed by #167
Closed

Empty exercise route #127

gabrielgouv opened this issue Aug 1, 2024 · 0 comments · Fixed by #167

Comments

@gabrielgouv
Copy link
Contributor

gabrielgouv commented Aug 1, 2024

Describe the bug
I'm trying to get the route of an exercise added via Google Fit (emulator with fake GPS and real device and real GPS), I've tested also with Samsung Health (same problem here), but it always returns an empty object. I don't know if it needs any extra configuration, but my permissions are as follows:

Permissions in code:

const grantedPermissions = await requestPermission([
    { accessType: "read", recordType: "ExerciseSession" },
    { accessType: "read", recordType: "Distance" },
    { accessType: "read", recordType: "ElevationGained" },
    { accessType: "read", recordType: "HeartRate" },
    { accessType: "read", recordType: "Power" },
    { accessType: "read", recordType: "Speed" },
    { accessType: "read", recordType: "Steps" },
    { accessType: "read", recordType: "TotalCaloriesBurned" },
    { accessType: "read", recordType: "CyclingPedalingCadence" },
]);

Android permissions (Expo app.json):

"permissions": [
        "android.permission.health.READ_EXERCISE_ROUTES",
        "android.permission.health.READ_EXERCISE",
        "android.permission.health.READ_DISTANCE",
        "android.permission.health.READ_ELEVATION_GAINED",
        "android.permission.health.READ_HEART_RATE",
        "android.permission.health.READ_POWER",
        "android.permission.health.READ_SPEED",
        "android.permission.health.READ_STEPS",
        "android.permission.health.READ_WORKOUTS",
        "android.permission.health.READ_TOTAL_CALORIES_BURNED"
],

I tested using both READ_EXERCISE_ROUTES and READ_EXERCISE_ROUTE.
No logcat errors.

To Reproduce
Steps to reproduce the behavior:

  1. Record a activity with GPS using Google Fit ou Samsung Health (emulator or real device)
  2. Read exercises
  3. Get exercise and check exerciseRoute object
  4. Object is empty

Expected behavior
Should return filled exercise route object.

Minimal Reproducible

// Empty here
const exerciseRecord = await readRecords("ExerciseSession", {
    timeRangeFilter: {
      operator: "between",
      startTime: "2024-07-09T12:00:00.405Z",
      endTime: "2024-08-20T23:53:15.405Z",
    },
});

// Empty here
const record = await readRecord(
      "ExerciseSession",
      exerciseRecord[0].metadata?.id as string,
);

Environment:
Health Connect Version: 2024.07.11.00.release
React Native Version: 0.74.3
New architecture enabled: No
Using Expo: Prebuild(Dev Client)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant