Giter Site home page Giter Site logo

capacitor-plugin-health's Introduction

Health

Uses Capacitor 3.0

Capacitor 3.0 plugin for Android and iOS that allows data to be sent and retrieved from Google Fit or Apple Health


Maintainer GitHub Social
Mick Patterson mpat8121 @Mick_Patterson_
G. Starr g-starr

Install

npm install capacitor-plugin-health
npm run build or ionic build
npx cap sync
npx cap add android
npx cap add ios

API

isAvailable()

isAvailable() => any

Checks if HealthKit is available

Returns: any

Since: 0.0.2


requestAuth()

requestAuth() => any

Request authorisation from the user to access Health app data

Returns: any

Since: 0.0.2


query(...)

query(options: HealthQueryOptions) => any

Retrieves data from Health app

Param Type Description
options HealthQueryOptions : HealthOptions

Returns: any

Since: 0.0.1


queryAll(...)

queryAll(options: HealthQueryAllOptions) => any
Param Type Description
options HealthQueryAllOptions : HealthOptions

Returns: any

Since: 0.0.1


store(...)

store(options: HealthStoreOptions) => any

Saves data in Health app

Param Type Description
options HealthStoreOptions : HealthOptions

Returns: any

Since: 0.0.2


Interfaces

HealthResponse

Prop Type Description
success boolean Response from plugin call
message string String message

HealthQueryOptions

Prop Type Description
startDate any Start date from which to get data
endDate any End date from which to get data
dataType HealthDataType Datatype to be queried

HealthQueryResponse

Prop Type Description
result {} (iOS/Android) single data type as result
data any (ANDROID ONLY) - all data object returns HealthData[]'s under data.weight, data.fat_percentage & data.height

HealthData

Prop Type Description
startDate any Start date from which to get data
endDate any End date from which to get data
value string Value of corresponding Datatype
unit string Unit of corresponding value of Datatype
sourceName string The source that produced this data. In iOS this is ignored and set automatically to the name of your app.
sourceBundleId string The complete package of the source that produced this data. In Android, if not specified, it's assigned to the package of the App. In iOS this is ignored and set automatically to the bunde id of the app.

HealthQueryAllOptions

Prop Type Description
limit number (Optional) limit the number of values returned. Defaults to 1000

HealthStoreOptions

Prop Type Description
startDate any Start date from which to get data
endDate any End date from which to get data
dataType HealthDataType Datatype to be queried
value string | number Value of corresponding Datatype

Enums

HealthDataType

Members Value Description
HEIGHT 'height' IOS/ANDROID - 'height'
WEIGHT 'weight' IOS/ANDROID - 'weight'
FAT_PERCENTAGE 'fat_percentage' IOS/ANDROID - 'fat_percentage'
BMI 'bmi' IOS ONLY - 'bmi'
WAIST 'waist' IOS ONLY - 'waist'

Supported Methods

Name Android iOS Web
isAvailable
requestAuth
query
queryAll
store

Contributors


Mick Patterson

💻

Graham Starr

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

capacitor-plugin-health's People

Contributors

graei avatar

Watchers

Mick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.