1.0.0 • Published 8 months ago
capacitor-healthkit-weight-plugin v1.0.0
capacitor-healthkit-weight
Plugin to get and set Apple Healthkit weight data. Created to be used on a private project.
You are welcome to use this package, and I will keep updated when I have the time.
PRs will be considered, but I am unlikely to respond to issues on this repo.
Install
npm install capacitor-healthkit-weight
npx cap sync
API
requestAuthorization(...)
isAvailable()
getAuthorizationStatus(...)
getBodyMassEntries(...)
setBodyMassEntry(...)
getUserIdentifier()
- Interfaces
- Type Aliases
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; }>
getBodyMassEntries(...)
getBodyMassEntries(options: BodyMassQueryOptions) => Promise<BodyMassQueryOutput>
Param | Type |
---|---|
options | BodyMassQueryOptions |
Returns: Promise<BodyMassQueryOutput>
setBodyMassEntry(...)
setBodyMassEntry(options: { value: number; date: string; }) => Promise<void>
Param | Type |
---|---|
options | { value: number; date: string; } |
getUserIdentifier()
getUserIdentifier() => Promise<{ value: string; }>
Returns: Promise<{ value: string; }>
Interfaces
RequestAuthorizationOptions
Prop | Type |
---|---|
all | string[] |
read | string[] |
write | string[] |
GetAuthorizationStatusOptions
Prop | Type |
---|---|
sampleType | string |
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 |
Type Aliases
AuthorizationStatus
'notDetermined' | 'sharingDenied' | 'sharingAuthorized'