Open ShineYang opened 1 year ago
Describe the bug When I use HealthKitReporter.workoutQuery(predicate) to retrieve workout data, harmonized.metadata always returns null.
To Reproduce try { final workouts = await HealthKitReporter.workoutQuery(predicate); workouts.forEach((element) { print('metadata: ${element.harmonized.metadata}'); }); } catch (e) { print(e); }
try { final workouts = await HealthKitReporter.workoutQuery(predicate); workouts.forEach((element) { print('metadata: ${element.harmonized.metadata}'); }); } catch (e) { print(e); }
Expected behavior The metadata should look like this: {HKAverageMETs: 4.85739 kcal/hr·kg, HKIndoorWorkout: 0, HKWeatherTemperature: 52.016 degF, HKWeatherHumidity: 7600 %, HKTimeZone: Asia/Shanghai, HKElevationAscended: 2403 cm}
{HKAverageMETs: 4.85739 kcal/hr·kg, HKIndoorWorkout: 0, HKWeatherTemperature: 52.016 degF, HKWeatherHumidity: 7600 %, HKTimeZone: Asia/Shanghai, HKElevationAscended: 2403 cm}
Additional context I think the reason might be that there's something wrong with Metadata.make()in the native code.
Metadata.make()
Hoping for this fix.. need elevation gain for my existing project
I have solution....for workout. i can use substrac 1 seconds for startDate and add 1 seconds for endDate.!
Regards!
Describe the bug When I use HealthKitReporter.workoutQuery(predicate) to retrieve workout data, harmonized.metadata always returns null.
To Reproduce
try { final workouts = await HealthKitReporter.workoutQuery(predicate); workouts.forEach((element) { print('metadata: ${element.harmonized.metadata}'); }); } catch (e) { print(e); }
Expected behavior The metadata should look like this:
{HKAverageMETs: 4.85739 kcal/hr·kg, HKIndoorWorkout: 0, HKWeatherTemperature: 52.016 degF, HKWeatherHumidity: 7600 %, HKTimeZone: Asia/Shanghai, HKElevationAscended: 2403 cm}
Additional context I think the reason might be that there's something wrong with
Metadata.make()
in the native code.