diff --git a/android/src/main/java/dev/matinzd/healthconnect/utils/HealthConnectUtils.kt b/android/src/main/java/dev/matinzd/healthconnect/utils/HealthConnectUtils.kt index 1f56670..0ca7a87 100644 --- a/android/src/main/java/dev/matinzd/healthconnect/utils/HealthConnectUtils.kt +++ b/android/src/main/java/dev/matinzd/healthconnect/utils/HealthConnectUtils.kt @@ -115,6 +115,7 @@ fun convertMetadataToJSMap(meta: Metadata): WritableNativeMap { putString("dataOrigin", meta.dataOrigin.packageName) putString("lastModifiedTime", meta.lastModifiedTime.toString()) putInt("device", meta.device?.type ?: 0) + putInt("recordingMethod", meta.recordingMethod) } } diff --git a/src/constants.ts b/src/constants.ts index 57a769b..11d87ee 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -422,3 +422,17 @@ export const ExerciseSegmentType = { /** Use this type for yoga. */ YOGA: 67, }; + +export const RecordingMethod = { + /** For actively recorded data by the user. */ + RECORDING_METHOD_ACTIVELY_RECORDED: 1, + + /** For passively recorded data by the app. */ + RECORDING_METHOD_AUTOMATICALLY_RECORDED: 2, + + /** For manually entered data by the user. */ + RECORDING_METHOD_MANUAL_ENTRY: 3, + + /** Unknown recording method. */ + RECORDING_METHOD_UNKNOWN: 0, +}; diff --git a/src/types/base.types.ts b/src/types/base.types.ts index 4a7a598..c735ea1 100644 --- a/src/types/base.types.ts +++ b/src/types/base.types.ts @@ -23,6 +23,8 @@ export interface Metadata { clientRecordVersion: number; // see: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Device device: number; + // Use RecordingType constant to compare + recordingMethod: number; } export type TimeRangeFilter =