cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
551 stars 681 forks source link

[Health 10.2.0] Adding routes to workouts #1000

Open CarlosCabarcos opened 4 months ago

CarlosCabarcos commented 4 months ago

Remember to specify the plugin name in the title!

Description

Describe what you will like to see improved/added/removed.

I have been experimenting a bit with the plugin and I realized that when trying to "writeWorkoutData", the only available parameters are the following:

/// Write workout data to Apple Health or Google Fit or Google Health Connect. /// /// Returns true if the workout data was successfully added. /// /// Parameters: /// - [activityType] The type of activity performed. /// - [start] The start time of the workout. /// - [end] The end time of the workout. /// - [totalEnergyBurned] The total energy burned during the workout. /// - [totalEnergyBurnedUnit] The UNIT used to measure [totalEnergyBurned] /// ONLY FOR IOS Default value is KILOCALORIE. /// - [totalDistance] The total distance traveled during the workout. /// - [totalDistanceUnit] The UNIT used to measure [totalDistance] /// ONLY FOR IOS Default value is METER. /// - [title] The title of the workout. /// ONLY FOR HEALTH CONNECT Default value is the [activityType], e.g. "STRENGTH_TRAINING".

I was wondering if there are any plans to include ROUTES in workouts, since when checking the Health Connect and Apple Health documentation, I've seen they are actually available.

In Health Connect, Exercise Sessions seem to include Routes. The constructor has an "exerciseRoute":

https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ExerciseSessionRecord

ExerciseSessionRecord( startTime: Instant, startZoneOffset: ZoneOffset?, endTime: Instant, endZoneOffset: ZoneOffset?, exerciseType: Int, title: String?, notes: String?, metadata: Metadata, segments: List, laps: List, exerciseRoute: ExerciseRoute? )

and in Apple's Healthkit they seem to be available too: https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/creating_a_workout_route

It seems like ROUTES would be a pretty relevant part of many kinds of workouts so it would be really helpful if it was added to the plugin.

Thank you very much.

yogeshButani commented 4 months ago

hii @CarlosCabarcos i have also used health package to get the steps data from health connect. On IOS devices it's working good, taking data from apple health successfully but when comes in android, its always showing 0 steps, i have all the setup for Android, even not getting any type of error still showing 0 steps don't know why...all permissions are enabled, app is also showing inside health connect settings on device...don't know how the issue is occurring... please help

CarlosCabarcos commented 3 months ago

hii @CarlosCabarcos i have also used health package to get the steps data from health connect. On IOS devices it's working good, taking data from apple health successfully but when comes in android, its always showing 0 steps, i have all the setup for Android, even not getting any type of error still showing 0 steps don't know why...all permissions are enabled, app is also showing inside health connect settings on device...don't know how the issue is occurring... please help

Hi @yogeshButani . I have not worked with stepcount so far, so I'm afraid I can't really help you at the moment.

However, this is a totally different topic to the one I was asking about in this post, perhaps you could open a new post/issue and ask there, someone might be able to help you better.