cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
550 stars 678 forks source link

[health: ^11.0.0] #1038

Open urvashi-k-7span opened 2 months ago

urvashi-k-7span commented 2 months ago

I am using this plugin to fetch steps data. It works perfectly fine with google fit.

In 2-3 devices I have Samsung health.

When I try to fetch data of today's date It it not returning STEPS

I/FLUTTER_HEALTH(22150): Getting data for STEPS between 2024-09-09T12:18:29Z and 2024-09-09T12:27:44.805Z, filtering by []
I/FLUTTER_HEALTH::SUCCESS(22150): returning 26 steps
I/flutter (22150): Total number of data points: 0. 

It has Steps 26 but not giving

 final healthData = await health.getHealthDataFromTypes(
          startTime: startTime,
          endTime: endTime,
          types: types,
        );
SlimShadyIAm commented 2 months ago

Samsung Health and Health Connect are separate, but Samsung Health has a setting to sync its data to Health Connect. If you enable it and give it time to sync, the steps should show up.

urvashi-k-7span commented 2 months ago

Able to receive the data, after troubleshooting that samsung provides data of whole day at once like if I pass start date with particular time it is not providing the data, but if I pass only date with time 00:00 it will provide one single object of 24 hours at once.

Samsung Health and Health Connect are separate, but Samsung Health has a setting to sync its data to Health Connect. If you enable it and give it time to sync, the steps should show up.