@perfood/capacitor-healthkit v2
This is a complete re-write of the original plugin and still work in progress. v2 will have a complete new API and some new features. By far not everything has been implemented yet. You can test the most recent release of v2 by installing @perfood/capacitor-healthkit@next
.
npm install @perfood/capacitor-healthkit@next
npx cap sync
requestAuthorization(...)
requestAuthorization(options: RequestAuthorizationOptions) => Promise<void>
isAvailable() => Promise<void>
getAuthorizationStatus(...)
getAuthorizationStatus(options: GetAuthorizationStatusOptions) => Promise<{ status: AuthorizationStatus; }>
Returns: Promise<{ status: AuthorizationStatus; }>
getStatisticsCollection(...)
getStatisticsCollection(options: StatisticsCollectionOptions) => Promise<StatisticsCollectionOutput>
Returns: Promise<StatisticsCollectionOutput>
getBodyMassEntries(options: BodyMassQueryOptions) => Promise<BodyMassQueryOutput>
Returns: Promise<BodyMassQueryOutput>
getWorkouts(options: WorkoutsQueryOptions) => Promise<WorkoutsQueryOutput>
Returns: Promise<WorkoutsQueryOutput>
RequestAuthorizationOptions
Prop |
Type |
all |
string[] |
read |
string[] |
write |
string[] |
GetAuthorizationStatusOptions
Prop |
Type |
sampleType |
string |
StatisticsCollectionOutput
Prop |
Type |
data |
{ startDate: string; endDate: string; value: number; }[] |
StatisticsCollectionOptions
StatisticsCollectionQueryInterval
Prop |
Type |
unit |
'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' |
value |
number |
Prop |
Type |
data |
{ date: string; value: number; unit: string; uuid: string; sourceName: string; sourceBundleId: string; }[] |
Prop |
Type |
startDate |
string |
endDate |
string |
limit |
number |
Prop |
Type |
data |
{ uuid: string; startDate: string; endDate: string; duration: number; device?: HealthKitDevice; source: string; sourceBundleId: string; workoutActivityType: string; workoutActivityTypeId: number; totalEnergyBurned?: number; totalDistance?: number; totalFlightsClimbed?: number; totalSwimmingStrokeCount?: number; }[] |
Prop |
Type |
name |
string |
model |
string |
manufacturer |
string |
hardwareVersion |
string |
softwareVersion |
string |
firmwareVersion |
string |
localIdentifier |
string |
udiDeviceIdentifier |
string |
Prop |
Type |
startDate |
string |
endDate |
string |
limit |
number |
'notDetermined' | 'sharingDenied' | 'sharingAuthorized'
'stepCount'