Android Health Connect integration for Capacitor
npm install capacitor-health-connect
npx cap sync android
import { HealthConnect } from 'capacitor-health-connect';
const healthConnectAvailability = await HealthConnect.checkAvailability();
checkAvailability()
insertRecords(...)
readRecord(...)
readRecords(...)
getChangesToken(...)
getChanges(...)
requestHealthPermissions(...)
checkHealthPermissions(...)
revokeHealthPermissions()
openHealthConnectSetting()
- Type Aliases
checkAvailability() => any
Returns: any
insertRecords(options: { records: Record[]; }) => any
Param | Type |
---|---|
options |
{ records: {}; } |
Returns: any
readRecord(options: { type: RecordType; recordId: string; }) => any
Param | Type |
---|---|
options |
{ type: RecordType; recordId: string; } |
Returns: any
readRecords(options: { type: RecordType; timeRangeFilter: TimeRangeFilter; dataOriginFilter?: string[]; ascendingOrder?: boolean; pageSize?: number; pageToken?: string; }) => any
Param | Type |
---|---|
options |
{ type: RecordType; timeRangeFilter: TimeRangeFilter; dataOriginFilter?: {}; ascendingOrder?: boolean; pageSize?: number; pageToken?: string; } |
Returns: any
getChangesToken(options: { types: RecordType[]; }) => any
Param | Type |
---|---|
options |
{ types: {}; } |
Returns: any
getChanges(options: { token: string; }) => any
Param | Type |
---|---|
options |
{ token: string; } |
Returns: any
requestHealthPermissions(options: { read: RecordType[]; write: RecordType[]; }) => any
Param | Type |
---|---|
options |
{ read: {}; write: {}; } |
Returns: any
checkHealthPermissions(options: { read: RecordType[]; write: RecordType[]; }) => any
Param | Type |
---|---|
options |
{ read: {}; write: {}; } |
Returns: any
revokeHealthPermissions() => any
Returns: any
openHealthConnectSetting() => any
Returns: any
'Available' | 'NotInstalled' | 'NotSupported'
{ type: 'ActiveCaloriesBurned'; startTime: Date; startZoneOffset?: string; endTime: Date; endZoneOffset?: string; energy: Energy; } | { type: 'BasalBodyTemperature'; time: Date; zoneOffset?: string; temperature: Temperature; measurementLocation: | 'unknown' | 'armpit' | 'finger' | 'forehead' | 'mouth' | 'rectum' | 'temporal_artery' | 'toe' | 'ear' | 'wrist' | 'vagina'; } | { type: 'BasalMetabolicRate'; time: Date; zoneOffset?: string; basalMetabolicRate: Power; } | { type: 'BloodGlucose'; time: Date; zoneOffset?: string; level: BloodGlucose; specimenSource: | 'unknown' | 'interstitial_fluid' | 'capillary_blood' | 'plasma' | 'serum' | 'tears' | 'whole_blood'; mealType: 'unknown' | 'breakfast' | 'lunch' | 'dinner' | 'snack'; relationToMeal: 'unknown' | 'general' | 'fasting' | 'before_meal' | 'after_meal'; } | { type: 'BloodPressure'; time: Date; zoneOffset?: string; systolic: Pressure; diastolic: Pressure; bodyPosition: 'unknown' | 'standing_up' | 'sitting_down' | 'lying_down' | 'reclining'; measurementLocation: 'unknown' | 'left_wrist' | 'right_wrist' | 'left_upper_arm' | 'right_upper_arm'; } | { type: 'BodyFat'; time: Date; zoneOffset?: string; percentage: Percentage; } | { type: 'BodyTemperature'; time: Date; zoneOffset?: string; temperature: Temperature; measurementLocation: 'unknown' | 'armpit' | 'finger' | 'forehead' | 'mouth' | 'rectum' | 'temporal_artery' | 'toe' | 'ear' | 'wrist' | 'vagina'; } | { type: 'HeartRateSeries'; startTime: Date; startZoneOffset?: string; endTime: Date; endZoneOffset?: string; samples: HeartRateSample[]; } | { type: 'Height'; time: Date; zoneOffset?: string; height: Length; } | { type: 'OxygenSaturation'; time: Date; zoneOffset?: string; percentage: Percentage; } | { type: 'RespiratoryRate'; time: Date; zoneOffset?: string; rate: number; } | { type: 'RestingHeartRate'; time: Date; zoneOffset?: string; beatsPerMinute: number; } | { type: 'Steps'; startTime: Date; startZoneOffset?: string; endTime: Date; endZoneOffset?: string; count: number; } | { type: 'Weight'; time: Date; zoneOffset?: string; weight: Mass; }
{ unit: 'calories' | 'kilocalories' | 'joules' | 'kilojoules'; value: number; }
{ unit: 'celsius' | 'fahrenheit'; value: number; }
{ unit: 'kilocaloriesPerDay' | 'watts'; value: number; }
{ unit: 'milligramsPerDeciliter' | 'millimolesPerLiter'; value: number; }
{ unit: 'millimetersOfMercury'; value: number; }
{ value: number; }
{ time: Date; beatsPerMinute: number; }
{ unit: 'meter' | 'kilometer' | 'mile' | 'inch' | 'feet'; value: number; }
{ unit: 'gram' | 'kilogram' | 'milligram' | 'microgram' | 'ounce' | 'pound'; value: number; }
'ActiveCaloriesBurned' | 'BasalBodyTemperature' | 'BasalMetabolicRate' | 'BloodGlucose' | 'BloodPressure' | 'BodyFat' | 'BodyTemperature' | 'HeartRateSeries' | 'Height' | 'OxygenSaturation' | 'RespiratoryRate' | 'RestingHeartRate' | 'Steps' | 'Weight'
{ metadata: RecordMetadata; }
{ id: string; clientRecordId?: string; clientRecordVersion: number; lastModifiedTime: Date; dataOrigin: string; }
{ type: 'before' | 'after'; time: Date; } | { type: 'between'; startTime: Date; endTime: Date; }
{ type: 'Upsert'; record: Record; } | { type: 'Delete'; recordId: string; }