@felipeclopes/capacitor-healthkit
TypeScript icon, indicating that this package has built-in type declarations

6.0.2 • Public • Published

@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.

Install

npm install @perfood/capacitor-healthkit@next
npx cap sync

API

requestAuthorization(...)

requestAuthorization(options: RequestAuthorizationOptions) => Promise<void>
Param Type
options RequestAuthorizationOptions

isAvailable()

isAvailable() => Promise<void>

getAuthorizationStatus(...)

getAuthorizationStatus(options: GetAuthorizationStatusOptions) => Promise<{ status: AuthorizationStatus; }>
Param Type
options GetAuthorizationStatusOptions

Returns: Promise<{ status: AuthorizationStatus; }>


getStatisticsCollection(...)

getStatisticsCollection(options: StatisticsCollectionOptions) => Promise<StatisticsCollectionOutput>
Param Type
options StatisticsCollectionOptions

Returns: Promise<StatisticsCollectionOutput>


getBodyMassEntries(...)

getBodyMassEntries(options: BodyMassQueryOptions) => Promise<BodyMassQueryOutput>
Param Type
options BodyMassQueryOptions

Returns: Promise<BodyMassQueryOutput>


getWorkouts(...)

getWorkouts(options: WorkoutsQueryOptions) => Promise<WorkoutsQueryOutput>
Param Type
options WorkoutsQueryOptions

Returns: Promise<WorkoutsQueryOutput>


Interfaces

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

Prop Type
startDate string
endDate string
anchorDate string
interval StatisticsCollectionQueryInterval
quantityTypeSampleName QuantityType

StatisticsCollectionQueryInterval

Prop Type
unit 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year'
value number

BodyMassQueryOutput

Prop Type
data { date: string; value: number; unit: string; uuid: string; sourceName: string; sourceBundleId: string; }[]

BodyMassQueryOptions

Prop Type
startDate string
endDate string
limit number

WorkoutsQueryOutput

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; }[]

HealthKitDevice

Prop Type
name string
model string
manufacturer string
hardwareVersion string
softwareVersion string
firmwareVersion string
localIdentifier string
udiDeviceIdentifier string

WorkoutsQueryOptions

Prop Type
startDate string
endDate string
limit number

Type Aliases

AuthorizationStatus

'notDetermined' | 'sharingDenied' | 'sharingAuthorized'

QuantityType

'stepCount'

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i @felipeclopes/capacitor-healthkit

    Weekly Downloads

    3

    Version

    6.0.2

    License

    MIT

    Unpacked Size

    73 kB

    Total Files

    25

    Last publish

    Collaborators

    • felipeclopes