matinzd/react-native-health-connect

Feature Request: Filtering Manually Added Data

Opened this issue · 7 comments

Feature Request: Filtering Manually Added Data

Description: I would like to request a feature that allows for the filtering of manually added data. Specifically, I am looking for the ability to:

  1. Retrieve data that excludes manually added entries. For example, fetching the number of steps without including those that were manually added. In iOS, the react-native-health library provides a flag to handle this.
  2. Fetch all real data and manually added data separately, so we can distinguish between the two types when needed.

Use Case: This feature is particularly useful when distinguishing between actual data collected by devices (like steps counted by a phone or a wearable) and any entries manually added by the user. It allows for more accurate tracking and reporting of physical activity and other health metrics.

Is this something that could be added or integrated into the library? Thank you for considering this request!

Hi,

quick question we are using it for our app in fitness and in ios it is very good as we can flag if users enter manual data but for android there is no way to know.
basically it is helpful for us as we are trying to know who really exercise and move and who do not as we are doing challenges and competition. This way we can help our users to be a better version of themselves but on android we have no visibility on this. There is a way to add a flag on android to flag manual data entry ?

Really appreciate your feedback on it.

As you can see here there is no option to filter out those options from health connect core client. If health connect adds it in the future we can implement it as well. But for now there is no way other than filtering them manually on JS side.

To manually filter in JS side you can use recordingMethod in the metadata object in the response.

export enum RecordingMethod {
/** Unknown recording method. */
RECORDING_METHOD_UNKNOWN = 0,
/**
* For actively recorded data by the user.
*
* For e.g. An exercise session actively recorded by the user using a phone or a watch
* device.
*/
RECORDING_METHOD_ACTIVELY_RECORDED = 1,
/**
* For passively recorded data by the app.
*
* For e.g. Steps data recorded by a watch or phone without the user starting a session.
*/
RECORDING_METHOD_AUTOMATICALLY_RECORDED = 2,
/**
* For manually entered data by the user.
*
* For e.g. Nutrition or weight data entered by the user.
*/
RECORDING_METHOD_MANUAL_ENTRY = 3,
}

Hope this helps you!

As you can see here there is no option to filter out those options from health connect core client. If health connect adds it in the future we can implement it as well. But for now there is no way other than filtering them manually on JS side.

To manually filter in JS side you can use recordingMethod in the metadata object in the response.

export enum RecordingMethod {
/** Unknown recording method. */
RECORDING_METHOD_UNKNOWN = 0,
/**
* For actively recorded data by the user.
*
* For e.g. An exercise session actively recorded by the user using a phone or a watch
* device.
*/
RECORDING_METHOD_ACTIVELY_RECORDED = 1,
/**
* For passively recorded data by the app.
*
* For e.g. Steps data recorded by a watch or phone without the user starting a session.
*/
RECORDING_METHOD_AUTOMATICALLY_RECORDED = 2,
/**
* For manually entered data by the user.
*
* For e.g. Nutrition or weight data entered by the user.
*/
RECORDING_METHOD_MANUAL_ENTRY = 3,
}

Hope this helps you!

However there is some issue regarding manual activities. As Health Connect not giving the correct value in metadata recordingMethod key it always giving 0 for unkown activity for all type of activities

User case : I have added some steps manually to Google FIT and some data automatically recorded but when I fetch the records then in metadata for both type of activity recording method is 0.

Please let me know if there is any workaround for that.

Thanks in Advance.

@matinzd @GSSPawanKumarSingh same issue for me, Health Connect always returns 0 for RecordingMethod, even if data were automatically tracked by Google Fit

As you can see here there is no option to filter out those options from health connect core client. If health connect adds it in the future we can implement it as well. But for now there is no way other than filtering them manually on JS side.
To manually filter in JS side you can use recordingMethod in the metadata object in the response.

export enum RecordingMethod {
/** Unknown recording method. */
RECORDING_METHOD_UNKNOWN = 0,
/**
* For actively recorded data by the user.
*
* For e.g. An exercise session actively recorded by the user using a phone or a watch
* device.
*/
RECORDING_METHOD_ACTIVELY_RECORDED = 1,
/**
* For passively recorded data by the app.
*
* For e.g. Steps data recorded by a watch or phone without the user starting a session.
*/
RECORDING_METHOD_AUTOMATICALLY_RECORDED = 2,
/**
* For manually entered data by the user.
*
* For e.g. Nutrition or weight data entered by the user.
*/
RECORDING_METHOD_MANUAL_ENTRY = 3,
}

Hope this helps you!

However there is some issue regarding manual activities. As Health Connect not giving the correct value in metadata recordingMethod key it always giving 0 for unkown activity for all type of activities

User case : I have added some steps manually to Google FIT and some data automatically recorded but when I fetch the records then in metadata for both type of activity recording method is 0.

Please let me know if there is any workaround for that.

Thanks in Advance.

Is there any update?

@matinzd @GSSPawanKumarSingh same issue for me, Health Connect always returns 0 for RecordingMethod, even if data were automatically tracked by Google Fit

I have tried with the native side as well. But it still gives 0 for all activities. What I concluded that Google Fit does not writing whether the steps are manual or auto. We have to raise it to google directly.

Currently the issue is still here.