From 46c9beb17fc4a71ed1dba35fb84d34ae770d76f5 Mon Sep 17 00:00:00 2001 From: Lucas Bordignon Date: Sat, 3 Oct 2020 17:27:10 -0300 Subject: [PATCH] Update README content --- README.md | 332 ++++++++---------- docs/Permissions.md | 21 -- docs/README.md | 84 +++++ docs/activities.md | 78 ++++ ...ype().md => authorizationStatusForType.md} | 0 ...gyBurned().md => getActiveEnergyBurned.md} | 0 ...rgyBurned().md => getBasalEnergyBurned.md} | 0 ...BiologicalSex().md => getBiologicalSex.md} | 0 ...().md => getBloodAlcoholContentSamples.md} | 0 ...Samples().md => getBloodGlucoseSamples.md} | 0 ...amples().md => getBloodPressureSamples.md} | 0 ...es().md => getBodyFatPercentageSamples.md} | 0 ...ples().md => getBodyTemperatureSamples.md} | 0 ...).md => getDailyDistanceCyclingSamples.md} | 0 ....md => getDailyDistanceSwimmingSamples.md} | 0 ... getDailyDistanceWalkingRunningSamples.md} | 0 ...().md => getDailyFlightsClimbedSamples.md} | 0 ...mples().md => getDailyStepCountSamples.md} | 0 ...{getDateOfBirth().md => getDateOfBirth.md} | 0 ...anceCycling().md => getDistanceCycling.md} | 0 ...ning().md => getDistanceWalkingRunning.md} | 0 ...ightsClimbed().md => getFlightsClimbed.md} | 0 ...ateSamples().md => getHeartRateSamples.md} | 0 ...).md => getHeartRateVariabilitySamples.md} | 0 ...HeightSamples().md => getHeightSamples.md} | 0 ...t().md => getLatestBloodAlcoholContent.md} | 0 docs/{getLatestBmi().md => getLatestBmi.md} | 0 ...age().md => getLatestBodyFatPercentage.md} | 0 ...etLatestHeight().md => getLatestHeight.md} | 0 ...BodyMass().md => getLatestLeanBodyMass.md} | 0 ...etLatestWeight().md => getLatestWeight.md} | 0 ...Samples().md => getLeanBodyMassSamples.md} | 0 ...ndfulSession().md => getMindfulSession.md} | 0 ...ples().md => getRespiratoryRateSamples.md} | 0 ...les().md => getRestingHeartRateSamples.md} | 0 docs/{getSamples().md => getSamples.md} | 0 ...etSleepSamples().md => getSleepSamples.md} | 0 docs/{getStepCount().md => getStepCount.md} | 0 ...Vo2MaxSamples().md => getVo2MaxSamples.md} | 0 ...WeightSamples().md => getWeightSamples.md} | 0 docs/getWorkout.md | 3 + docs/{initHealthKit().md => initHealthKit.md} | 0 ...Observer().md => initStepCountObserver.md} | 0 docs/{isAvailable().md => isAvailable.md} | 0 docs/observers.md | 13 + docs/permissions.md | 126 +++++++ docs/saveBloodAlcoholContent.md | 4 + docs/saveBloodGlucoseSample.md | 5 + docs/{saveBmi().md => saveBmi.md} | 0 ...rcentage().md => saveBodyFatPercentage.md} | 0 docs/saveFood.md | 3 + docs/{saveHeight().md => saveHeight.md} | 0 ...eLeanBodyMass().md => saveLeanBodyMass.md} | 0 ...dfulSession().md => saveMindfulSession.md} | 0 docs/{saveSteps().md => saveSteps.md} | 0 docs/saveWater.md | 3 + docs/{saveWeight().md => saveWeight.md} | 0 docs/saveWorkout.md | 3 + docs/{setObserver().md => setObserver.md} | 0 docs/units.md | 27 ++ 60 files changed, 502 insertions(+), 200 deletions(-) delete mode 100644 docs/Permissions.md create mode 100644 docs/README.md create mode 100644 docs/activities.md rename docs/{authorizationStatusForType().md => authorizationStatusForType.md} (100%) rename docs/{getActiveEnergyBurned().md => getActiveEnergyBurned.md} (100%) rename docs/{getBasalEnergyBurned().md => getBasalEnergyBurned.md} (100%) rename docs/{getBiologicalSex().md => getBiologicalSex.md} (100%) rename docs/{getBloodAlcoholContentSamples().md => getBloodAlcoholContentSamples.md} (100%) rename docs/{getBloodGlucoseSamples().md => getBloodGlucoseSamples.md} (100%) rename docs/{getBloodPressureSamples().md => getBloodPressureSamples.md} (100%) rename docs/{getBodyFatPercentageSamples().md => getBodyFatPercentageSamples.md} (100%) rename docs/{getBodyTemperatureSamples().md => getBodyTemperatureSamples.md} (100%) rename docs/{getDailyDistanceCyclingSamples().md => getDailyDistanceCyclingSamples.md} (100%) rename docs/{getDailyDistanceSwimmingSamples().md => getDailyDistanceSwimmingSamples.md} (100%) rename docs/{getDailyDistanceWalkingRunningSamples().md => getDailyDistanceWalkingRunningSamples.md} (100%) rename docs/{getDailyFlightsClimbedSamples().md => getDailyFlightsClimbedSamples.md} (100%) rename docs/{getDailyStepCountSamples().md => getDailyStepCountSamples.md} (100%) rename docs/{getDateOfBirth().md => getDateOfBirth.md} (100%) rename docs/{getDistanceCycling().md => getDistanceCycling.md} (100%) rename docs/{getDistanceWalkingRunning().md => getDistanceWalkingRunning.md} (100%) rename docs/{getFlightsClimbed().md => getFlightsClimbed.md} (100%) rename docs/{getHeartRateSamples().md => getHeartRateSamples.md} (100%) rename docs/{getHeartRateVariabilitySamples().md => getHeartRateVariabilitySamples.md} (100%) rename docs/{getHeightSamples().md => getHeightSamples.md} (100%) rename docs/{getLatestBloodAlcoholContent().md => getLatestBloodAlcoholContent.md} (100%) rename docs/{getLatestBmi().md => getLatestBmi.md} (100%) rename docs/{getLatestBodyFatPercentage().md => getLatestBodyFatPercentage.md} (100%) rename docs/{getLatestHeight().md => getLatestHeight.md} (100%) rename docs/{getLatestLeanBodyMass().md => getLatestLeanBodyMass.md} (100%) rename docs/{getLatestWeight().md => getLatestWeight.md} (100%) rename docs/{getLeanBodyMassSamples().md => getLeanBodyMassSamples.md} (100%) rename docs/{getMindfulSession().md => getMindfulSession.md} (100%) rename docs/{getRespiratoryRateSamples().md => getRespiratoryRateSamples.md} (100%) rename docs/{getRestingHeartRateSamples().md => getRestingHeartRateSamples.md} (100%) rename docs/{getSamples().md => getSamples.md} (100%) rename docs/{getSleepSamples().md => getSleepSamples.md} (100%) rename docs/{getStepCount().md => getStepCount.md} (100%) rename docs/{getVo2MaxSamples().md => getVo2MaxSamples.md} (100%) rename docs/{getWeightSamples().md => getWeightSamples.md} (100%) create mode 100644 docs/getWorkout.md rename docs/{initHealthKit().md => initHealthKit.md} (100%) rename docs/{initStepCountObserver().md => initStepCountObserver.md} (100%) rename docs/{isAvailable().md => isAvailable.md} (100%) create mode 100644 docs/observers.md create mode 100644 docs/permissions.md create mode 100644 docs/saveBloodAlcoholContent.md create mode 100644 docs/saveBloodGlucoseSample.md rename docs/{saveBmi().md => saveBmi.md} (100%) rename docs/{saveBodyFatPercentage().md => saveBodyFatPercentage.md} (100%) create mode 100644 docs/saveFood.md rename docs/{saveHeight().md => saveHeight.md} (100%) rename docs/{saveLeanBodyMass().md => saveLeanBodyMass.md} (100%) rename docs/{saveMindfulSession().md => saveMindfulSession.md} (100%) rename docs/{saveSteps().md => saveSteps.md} (100%) create mode 100644 docs/saveWater.md rename docs/{saveWeight().md => saveWeight.md} (100%) create mode 100644 docs/saveWorkout.md rename docs/{setObserver().md => setObserver.md} (100%) create mode 100644 docs/units.md diff --git a/README.md b/README.md index ad0afcbd..d2c4774f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # React Native Health A React Native package to interact with Apple HealthKit for iOS. @@ -33,6 +34,154 @@ Update the `info.plist` file in your project Share workout data with other apps. ``` +## Usage + +In order to start collecting or saving data to HealthKit, you need to request +the user's permissions for the given data types. It can be done in the following +way + +```typescript +import AppleHealthKit, { HealthValue, HealthKitPermissions } from 'react-native-health'; + +/* Permission options */ +const permissions = { + permissions: { + read: [ + AppleHealthKit.Constants.Permissions.HeartRate, + ], + write: [ + AppleHealthKit.Constants.Permissions.Steps, + ], + } +} as HealthKitPermissions + + +AppleHealthKit.initHealthKit(permissions, (error: string) => { + /* Called after we receive a response from the system */ + + if (error) { + console.log('[ERROR] Cannot grant permissions!') + } + + /* Can now read or write to HealthKit */ + + const options = { + startDate: (new Date(2020, 1, 1)).toISOString(), + } + + AppleHealthKit.getHeartRateSamples(options, (callbackError: string, results: HealthValue[]) => { + /* Samples are now collected from HealthKit */ + }); +} +``` + +## Documentation + +All the documentation is under the [docs](/docs) folder. Additionally, +they are splitted in the following categories + +### Constants + * [Activities](/docs/activities.md) + * [Observers](/docs/observers.md) + * [Permissions](/docs/permissions.md) + * [Units](/docs/units.md) + +### Base Methods + * [isAvailable](/docs/isAvailable.md) + * [initHealthKit](/docs/initHealthKit.md) + * [authorizationStatusForType](/docs/authorizationStatusForType.md) + +### Background Methods + * [initStepCountObserver](/docs/initStepCountObserver.md) + * [setObserver](/docs/setObserver.md) + +### Activity Methods + * [getActiveEnergyBurned](/docs/getActiveEnergyBurned.md) + * [getBasalEnergyBurned](/docs/getBasalEnergyBurned.md) + +### Body Methods + * [getLatestHeight](/docs/getLatestHeight.md) + * [getLatestWeight](/docs/getLatestWeight.md) + * [getHeightSamples](/docs/getHeightSamples.md) + * [getWeightSamples](/docs/getWeightSamples.md) + * [getBodyTemperatureSamples](/docs/getBodyTemperatureSamples.md) + * [getLatestBodyFatPercentage](/docs/getLatestBodyFatPercentage.md) + * [getBodyFatPercentageSamples](/docs/getBodyFatPercentageSamples.md) + * [getLatestLeanBodyMass](/docs/getLatestLeanBodyMass.md) + * [getLeanBodyMassSamples](/docs/getLeanBodyMassSamples.md) + * [saveHeight](/docs/saveHeight.md) + * [saveWeight](/docs/saveWeight.md) + * [saveBodyFatPercentage](/docs/saveBodyFatPercentage.md) + * [saveLeanBodyMass](/docs/saveLeanBodyMass.md) + +### Characteristic Methods + * [getBiologicalSex](/docs/getBiologicalSex.md) + * [getDateOfBirth](/docs/getDateOfBirth.md) + +### Dietary Methods + * [saveFood](/docs/saveFood.md) + * [saveWater](/docs/saveWater.md) + +### Fitness Methods + * [getDailyStepCountSamples](/docs/getDailyStepCountSamples.md) + * [getStepCount](/docs/getStepCount.md) + * [getSamples](docs/getSamples.md) + * [getDailyDistanceWalkingRunningSamples](/docs/getDailyDistanceWalkingRunningSamples.md) + * [getDistanceWalkingRunning](/docs/getDistanceWalkingRunning.md) + * [getDistanceSwimming](/docs/getDistanceSwimming.md) + * [getDailyDistanceCyclingSamples](/docs/getDailyDistanceCyclingSamples.md) + * [getDistanceCycling](/docs/getDistanceCycling.md) + * [getDailyFlightsClimbedSamples](/docs/getDailyFlightsClimbedSamples.md) + * [getFlightsClimbed](/docs/getFlightsClimbed.md) + * [saveSteps](/docs/saveSteps.md) + +### Lab Tests Methods + * [getBloodAlcoholContentSamples](/docs/getBloodAlcoholContentSamples.md) + * [getBloodGlucoseSamples](/docs/getBloodglucoseSamples.md) + * [getLatestBloodAlcoholContent](/docs/getLatestBloodAlcoholContent.md) + * [saveBloodAlcoholContent](/docs/saveBloodAlcoholContent.md) + * [saveBloodGlucoseSample](/docs/saveBloodGlucoseSample.md) + +### Mindfulness Methods + * [getMindfulSession](docs/getMindfulSession.md) + * [saveMindfulSession](/docs/saveMindfulSession.md) + +### Sleep Methods + * [getSleepSamples](/docs/getSleepSamples.md) + +#### Vitals Methods + * [getBloodPressureSamples](/docs/getBloodPressureSamples.md) + * [getHeartRateSamples](/docs/getHeartRateSamples.md) + * [getHeartRateVariabilitySamples](/docs/getHeartRateVariabilitySamples.md) + * [getRestingHeartRateSamples](/docs/getRestingHeartRateSamples.md) + * [getVo2MaxSamples](/docs/getVo2MaxSamples.md) + * [getLatestBmi](/docs/getLatestBmi.md) + * [getRespiratoryRateSamples](/docs/getRespiratoryRateSamples.md) + * [saveBmi](/docs/saveBmi.md) + +#### Workout Methods + * [getWorkout](/docs/getWorkout.md) + * [saveWorkout](/docs/saveWorkout.md) + +## Additional Information + +### Permissions + +Due to Apple's privacy model, if a user has previously denied a +specific permission they will not be prompted again for that permission. +The user will need to go into the Apple Health app and grant the +permission to your app. + +For any data written to Healthkit, an authorization error can be caught. If +an authorization error occurs, you can prompt the user to set the +specific permission or add the permission to the options object when +initializing the library. + +If extra read or write permissions are added to the options object, the +app will request for user's permission to them when the library is +initialized again. + + ### Manual Installation 1. Run `yarn add react-native-health` @@ -49,186 +198,11 @@ and `$(SRCROOT)/../../../React` - mark both as `recursive`. ![](https://i.imgur.com/Ql1kXCg.png "Xcode Capabilities Section") 7. Compile and run -## Get Started -Initialize Healthkit. This will show the Healthkit permissions prompt for any read/write permissions set in the required `options` object. - -Due to Apple's privacy model if an app user has previously denied a specific permission then they can not be prompted again for that same permission. The app user would have to go into the Apple Health app and grant the permission to your react-native app under *sources* tab. - -For any data that is read from Healthkit the status/error is the same for both. This privacy restriction results in having no knowledge of whether the permission was denied (make sure it's added to the permissions options object), or the data for the specific request was nil (ex. no steps recorded today). - -For any data written to Healthkit an authorization error can be caught. If an authorization error occurs you can prompt the user to set the specific permission or add the permission to the options object if not present. - -If new read/write permissions are added to the options object then the app user will see the Healthkit permissions prompt with the new permissions to allow. - -`initHealthKit` requires an options object with Healthkit permission settings -```javascript -let options = { - permissions: { - read: ["Height", "Weight", "StepCount", "DateOfBirth", "BodyMassIndex", "ActiveEnergyBurned"], - write: ["Height", "Weight", "StepCount", "BodyMassIndex", "Biotin", "Caffeine", "Calcium", "Carbohydrates", "Chloride", "Cholesterol", "Copper", "EnergyConsumed", "FatMonounsaturated", "FatPolyunsaturated", "FatSaturated", "FatTotal", "Fiber", "Folate", "Iodine", "Iron", "Magnesium", "Manganese", "Molybdenum", "Niacin", "PantothenicAcid", "Phosphorus", "Potassium", "Protein", "Riboflavin", "Selenium", "Sodium", "Sugar", "Thiamin", "VitaminA", "VitaminB12", "VitaminB6", "VitaminC", "VitaminD", "VitaminE", "VitaminK", "Zinc", "Water"] - } -}; -``` - -```javascript -import AppleHealthKit from 'react-native-health'; - -AppleHealthKit.initHealthKit(options: Object, (err: string, results: Object) => { - if (err) { - console.log("error initializing Healthkit: ", err); - return; - } - - // Height Example - AppleHealthKit.getDateOfBirth(null, (err: Object, results: Object) => { - if (this._handleHealthkitError(err, 'getDateOfBirth')) { - return; - } - console.log(results) - }); - -}); -``` - -```javascript -{ - value: '1986-09-01T00:00:00.000-0400', - age: 29 -} -``` - -## Documentation - * [Installation](/docs/Install) - * [Documentation](#documentation) - * [Permissions](#supported-apple-permissions) - * [Units](#units) - * Base Methods - * [isAvailable](/docs/isAvailable().md) - * [initHealthKit](/docs/initHealthKit().md) - * [authorizationStatusForType](/docs/authorizationStatusForType().md) - * Realtime Methods - * [initStepCountObserver](/docs/initStepCountObserver().md) - * [setObserver](/docs/setObserver().md) - * Read Methods - * [getActiveEnergyBurned](/docs/getActiveEnergyBurned().md) - * [getBasalEnergyBurned](/docs/getBasalEnergyBurned().md) - * [getBiologicalSex](/docs/getBiologicalSex().md) - * [getBloodAlcoholContentSamples](/docs/getBloodAlcoholContentSamples().md) - * [getBloodGlucoseSamples](/docs/getBloodglucoseSamples().md) - * [getBloodPressureSamples](/docs/getBloodPressureSamples().md) - * [getBodyTemperatureSamples](/docs/getBodyTemperatureSamples().md) - * [getDailyDistanceCyclingSamples](/docs/getDailyDistanceCyclingSamples().md) - * [getDailyDistanceWalkingRunningSamples](/docs/getDailyDistanceWalkingRunningSamples().md) - * [getDailyFlightsClimbedSamples](/docs/getDailyFlightsClimbedSamples().md) - * [getDailyStepCountSamples](/docs/getDailyStepCountSamples().md) - * [getDateOfBirth](/docs/getDateOfBirth().md) - * [getDistanceCycling](/docs/getDistanceCycling().md) - * [getDistanceSwimming](/docs/getDistanceSwimming().md) - * [getDistanceWalkingRunning](/docs/getDistanceWalkingRunning().md) - * [getFlightsClimbed](/docs/getFlightsClimbed().md) - * [getHeartRateSamples](/docs/getHeartRateSamples().md) - * [getHeartRateVariabilitySamples](/docs/getHeartRateVariabilitySamples().md) - * [getRestingHeartRateSamples](/docs/getRestingHeartRateSamples().md) - * [getVo2MaxSamples](/docs/getVo2MaxSamples().md) - * [getHeightSamples](/docs/getHeightSamples().md) - * [getLatestBloodAlcoholContent](/docs/getLatestBloodAlcoholContent().md) - * [getLatestBmi](/docs/getLatestBmi().md) - * [getLatestBodyFatPercentage](/docs/getLatestBodyFatPercentage().md) - * [getBodyFatPercentageSamples](/docs/getBodyFatPercentageSamples().md) - * [getLatestHeight](/docs/getLatestHeight().md) - * [getLatestLeanBodyMass](/docs/getLatestLeanBodyMass().md) - * [getLeanBodyMassSamples](/docs/getLeanBodyMassSamples().md) - * [getLatestWeight](/docs/getLatestWeight().md) - * [getRespiratoryRateSamples](/docs/getRespiratoryRateSamples().md) - * [getSleepSamples](/docs/getSleepSamples().md) - * [getStepCount](/docs/getStepCount().md) - * [getWeightSamples](/docs/getWeightSamples().md) - * [getSamples](docs/getSamples().md) - * [getMindfulSession](docs/getMindfulSession().md) - * Write Methods - * [saveBmi](/docs/saveBmi().md) - * [saveHeight](/docs/saveHeight().md) - * [saveMindfulSession](/docs/saveMindfulSession().md) - * [saveWeight](/docs/saveWeight().md) - * [saveSteps](/docs/saveSteps().md) - * [saveBodyFatPercentage](/docs/saveBodyFatPercentage().md) - * [saveLeanBodyMass](/docs/saveLeanBodyMass().md) - * [References](#references) - -## Supported Apple Permissions - -The available Healthkit permissions to use with `initHealthKit` - -| Permission | Healthkit Identifier Type | Read | Write | -|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|-------| -| ActiveEnergyBurned | [HKQuantityTypeIdentifierActiveEnergyBurned](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615771-activeenergyburned?language=objc) | ✓ | | -| BasalEnergyBurned | [HKQuantityTypeIdentifierBasalEnergyBurned](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615512-basalenergyburned?language=objc) | ✓ | | -| BiologicalSex | [HKCharacteristicTypeIdentifierBiologicalSex](https://developer.apple.com/reference/Healthkit/hkcharacteristictypeidentifierbiologicalsex?language=objc) | ✓ | | -| BloodAlcoholContent | [HKQuantityTypeIdentifierBloodAlcoholContent](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbloodalcoholcontent?language=objc) | ✓ | ✓ | -| BloodGlucose | [HKQuantityTypeIdentifierBloodGlucose](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbloodglucose?language=objc) | ✓ | | -| BloodPressureDiastolic | [HKQuantityTypeIdentifierBloodPressureDiastolic](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodpressurediastolic?language=objc) | ✓ | ✓ | -| BloodPressureSystolic | [HKQuantityTypeIdentifierBloodPressureSystolic](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodpressuresystolic?language=objc) | ✓ | ✓ | -| BodyMassIndex | [HKQuantityTypeIdentifierBodyMassIndex](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodymassindex?language=objc) | ✓ | ✓ | -| BodyTemperature | [HKQuantityTypeIdentifierBodyTemperature](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodytemperature?language=objc) | ✓ | | -| DateOfBirth | [HKCharacteristicTypeIdentifierDateOfBirth](https://developer.apple.com/reference/Healthkit/hkcharacteristictypeidentifierdateofbirth?language=objc) | ✓ | | -| DistanceCycling | [HKQuantityTypeIdentifierDistanceCycling](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierdistancecycling?language=objc) | ✓ | ✓ | -| DistanceWalkingRunning | [HKQuantityTypeIdentifierDistanceWalkingRunning](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierdistancewalkingrunning?language=objc) | ✓ | ✓ | -| FlightsClimbed | [HKQuantityTypeIdentifierFlightsClimbed](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierflightsclimbed?language=objc) | ✓ | ✓ | -| HeartRate | [HKQuantityTypeIdentifierHeartRate](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierheartrate?language=objc) | ✓ | | -| Height | [HKQuantityTypeIdentifierHeight](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierheight?language=objc) | ✓ | ✓ | -| LeanBodyMass | [HKQuantityTypeIdentifierLeanBodyMass](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierleanbodymass?language=objc) | ✓ | ✓ | -| MindfulSession | [HKCategoryTypeIdentifierMindfulSession](https://developer.apple.com/reference/healthkit/hkcategorytypeidentifiermindfulsession?language=objc) | | ✓ | -| RespiratoryRate | [HKQuantityTypeIdentifierRespiratoryRate](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierrespiratoryrate?language=objc) | ✓ | | -| SleepAnalysis | [HKCategoryTypeIdentifierSleepAnalysis](https://developer.apple.com/reference/Healthkit/hkcategorytypeidentifiersleepanalysis?language=objc) | ✓ | | -| StepCount | [HKQuantityTypeIdentifierStepCount](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierstepcount?language=objc) | ✓ | ✓ | -| Steps | [HKQuantityTypeIdentifierSteps](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifiersteps?language=objc) | ✓ | ✓ | -| Weight | [HKQuantityTypeIdentifierBodyMass](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodymass?language=objc) | ✓ | ✓ | -| BodyFatPercentage | [HKQuantityTypeIdentifierBodyFatPercentage](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodyfatpercentage?language=objc) | ✓ | ✓ | - -These permissions are exported as constants of the `react-native-health` module. - -```javascript -import AppleHealthKit from 'react-native-health'; - -// get the available permissions from AppleHealthKit.Constants object -const PERMS = AppleHealthKit.Constants.Permissions; - -// setup healthkit read/write permissions using PERMS -const healthKitOptions = { - permissions: { - read: [ - PERMS.StepCount, - PERMS.Height, - ], - write: [ - PERMS.StepCount - ], - } -}; -``` - -## Units -- bpm -- calorie -- celsius -- count -- day -- fahrenheit -- foot -- gram -- hour -- inch -- joule -- meter -- mgPerdL -- mile -- minute -- mmhg -- mmolPerL -- percent -- pound -- second +## Contributing +We appreciate any additional request and/or contribution to `react-native-health`. +The [issues](https://github.com/agencyenterprise/react-native-health/issues) tracker +is used to keep a list of features and bugs to be worked on. ## References - [Apple Healthkit Documentation](https://developer.apple.com/documentation/healthkit) diff --git a/docs/Permissions.md b/docs/Permissions.md deleted file mode 100644 index 15b0778f..00000000 --- a/docs/Permissions.md +++ /dev/null @@ -1,21 +0,0 @@ -These permissions are exported as constants of the `react-native-health` module. - -```javascript -import AppleHealthKit from 'react-native-health'; - -// get the available permissions from AppleHealthKit.Constants object -const PERMS = AppleHealthKit.Constants.Permissions; - -// setup healthkit read/write permissions using PERMS -const healthKitOptions = { - permissions: { - read: [ - PERMS.StepCount, - PERMS.Height, - ], - write: [ - PERMS.StepCount - ], - } -}; -``` diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..a570950d --- /dev/null +++ b/docs/README.md @@ -0,0 +1,84 @@ +# Documentation + +### Constants + * [Activities](activities.md) + * [Observers](observers.md) + * [Permissions](permissions.md) + * [Units](units.md) + +### Base Methods + * [isAvailable](isAvailable.md) + * [initHealthKit](initHealthKit.md) + * [authorizationStatusForType](authorizationStatusForType.md) + +### Background Methods + * [initStepCountObserver](initStepCountObserver.md) + * [setObserver](setObserver.md) + +### Activity Methods + * [getActiveEnergyBurned](getActiveEnergyBurned.md) + * [getBasalEnergyBurned](getBasalEnergyBurned.md) + +### Body Methods + * [getLatestHeight](getLatestHeight.md) + * [getLatestWeight](getLatestWeight.md) + * [getHeightSamples](getHeightSamples.md) + * [getWeightSamples](getWeightSamples.md) + * [getBodyTemperatureSamples](getBodyTemperatureSamples.md) + * [getLatestBodyFatPercentage](getLatestBodyFatPercentage.md) + * [getBodyFatPercentageSamples](getBodyFatPercentageSamples.md) + * [getLatestLeanBodyMass](getLatestLeanBodyMass.md) + * [getLeanBodyMassSamples](getLeanBodyMassSamples.md) + * [saveHeight](saveHeight.md) + * [saveWeight](saveWeight.md) + * [saveBodyFatPercentage](saveBodyFatPercentage.md) + * [saveLeanBodyMass](saveLeanBodyMass.md) + +### Characteristic Methods + * [getBiologicalSex](getBiologicalSex.md) + * [getDateOfBirth](getDateOfBirth.md) + +### Dietary Methods + * [saveFood](saveFood.md) + * [saveWater](saveWater.md) + +### Fitness Methods + * [getDailyStepCountSamples](getDailyStepCountSamples.md) + * [getStepCount](getStepCount.md) + * [getSamples](docs/getSamples.md) + * [getDailyDistanceWalkingRunningSamples](getDailyDistanceWalkingRunningSamples.md) + * [getDistanceWalkingRunning](getDistanceWalkingRunning.md) + * [getDistanceSwimming](getDistanceSwimming.md) + * [getDailyDistanceCyclingSamples](getDailyDistanceCyclingSamples.md) + * [getDistanceCycling](getDistanceCycling.md) + * [getDailyFlightsClimbedSamples](getDailyFlightsClimbedSamples.md) + * [getFlightsClimbed](getFlightsClimbed.md) + * [saveSteps](saveSteps.md) + +### Lab Tests Methods + * [getBloodAlcoholContentSamples](getBloodAlcoholContentSamples.md) + * [getBloodGlucoseSamples](getBloodglucoseSamples.md) + * [getLatestBloodAlcoholContent](getLatestBloodAlcoholContent.md) + * [saveBloodAlcoholContent](saveBloodAlcoholContent.md) + * [saveBloodGlucoseSample](saveBloodGlucoseSample.md) + +### Mindfulness Methods + * [getMindfulSession](docs/getMindfulSession.md) + * [saveMindfulSession](saveMindfulSession.md) + +### Sleep Methods + * [getSleepSamples](getSleepSamples.md) + +#### Vitals Methods + * [getBloodPressureSamples](getBloodPressureSamples.md) + * [getHeartRateSamples](getHeartRateSamples.md) + * [getHeartRateVariabilitySamples](getHeartRateVariabilitySamples.md) + * [getRestingHeartRateSamples](getRestingHeartRateSamples.md) + * [getVo2MaxSamples](getVo2MaxSamples.md) + * [getLatestBmi](getLatestBmi.md) + * [getRespiratoryRateSamples](getRespiratoryRateSamples.md) + * [saveBmi](saveBmi.md) + +#### Workout Methods + * [getWorkout](getWorkout.md) + * [saveWorkout](saveWorkout.md) diff --git a/docs/activities.md b/docs/activities.md new file mode 100644 index 00000000..b7d836ca --- /dev/null +++ b/docs/activities.md @@ -0,0 +1,78 @@ +# Activities + +The following activities are supported by the library + +``` + AmericanFootball + Archery + AustralianFootball + Badminton + Baseball + Basketball + Bowling + Boxing + Climbing + Cricket + CrossTraining + Curling + Cycling + Dance + Elliptical + EquestrianSports + Fencing + Fishing + FunctionalStrengthTraining + Golf + Gymnastics + Handball + Hiking + Hockey + Hunting + Lacrosse + MartialArts + MindAndBody + PaddleSports + Play + PreparationAndRecovery + Racquetball + Rowing + Rugby + Running + Sailing + SkatingSports + SnowSports + Soccer + Softball + Squash + StairClimbing + SurfingSports + Swimming + TableTennis + Tennis + TrackAndField + TraditionalStrengthTraining + Volleyball + Walking + WaterFitness + WaterPolo + WaterSports + Wrestling + Yoga + Barre + CoreTraining + CrossCountrySkiing + DownhillSkiing + Flexibility + HighIntensityIntervalTraining + JumpRope + Kickboxing + Pilates + Snowboarding + Stairs + StepTraining + WheelchairWalkPace + WheelchairRunPace + TaiChi + MixedCardio + HandCycling +``` diff --git a/docs/authorizationStatusForType().md b/docs/authorizationStatusForType.md similarity index 100% rename from docs/authorizationStatusForType().md rename to docs/authorizationStatusForType.md diff --git a/docs/getActiveEnergyBurned().md b/docs/getActiveEnergyBurned.md similarity index 100% rename from docs/getActiveEnergyBurned().md rename to docs/getActiveEnergyBurned.md diff --git a/docs/getBasalEnergyBurned().md b/docs/getBasalEnergyBurned.md similarity index 100% rename from docs/getBasalEnergyBurned().md rename to docs/getBasalEnergyBurned.md diff --git a/docs/getBiologicalSex().md b/docs/getBiologicalSex.md similarity index 100% rename from docs/getBiologicalSex().md rename to docs/getBiologicalSex.md diff --git a/docs/getBloodAlcoholContentSamples().md b/docs/getBloodAlcoholContentSamples.md similarity index 100% rename from docs/getBloodAlcoholContentSamples().md rename to docs/getBloodAlcoholContentSamples.md diff --git a/docs/getBloodGlucoseSamples().md b/docs/getBloodGlucoseSamples.md similarity index 100% rename from docs/getBloodGlucoseSamples().md rename to docs/getBloodGlucoseSamples.md diff --git a/docs/getBloodPressureSamples().md b/docs/getBloodPressureSamples.md similarity index 100% rename from docs/getBloodPressureSamples().md rename to docs/getBloodPressureSamples.md diff --git a/docs/getBodyFatPercentageSamples().md b/docs/getBodyFatPercentageSamples.md similarity index 100% rename from docs/getBodyFatPercentageSamples().md rename to docs/getBodyFatPercentageSamples.md diff --git a/docs/getBodyTemperatureSamples().md b/docs/getBodyTemperatureSamples.md similarity index 100% rename from docs/getBodyTemperatureSamples().md rename to docs/getBodyTemperatureSamples.md diff --git a/docs/getDailyDistanceCyclingSamples().md b/docs/getDailyDistanceCyclingSamples.md similarity index 100% rename from docs/getDailyDistanceCyclingSamples().md rename to docs/getDailyDistanceCyclingSamples.md diff --git a/docs/getDailyDistanceSwimmingSamples().md b/docs/getDailyDistanceSwimmingSamples.md similarity index 100% rename from docs/getDailyDistanceSwimmingSamples().md rename to docs/getDailyDistanceSwimmingSamples.md diff --git a/docs/getDailyDistanceWalkingRunningSamples().md b/docs/getDailyDistanceWalkingRunningSamples.md similarity index 100% rename from docs/getDailyDistanceWalkingRunningSamples().md rename to docs/getDailyDistanceWalkingRunningSamples.md diff --git a/docs/getDailyFlightsClimbedSamples().md b/docs/getDailyFlightsClimbedSamples.md similarity index 100% rename from docs/getDailyFlightsClimbedSamples().md rename to docs/getDailyFlightsClimbedSamples.md diff --git a/docs/getDailyStepCountSamples().md b/docs/getDailyStepCountSamples.md similarity index 100% rename from docs/getDailyStepCountSamples().md rename to docs/getDailyStepCountSamples.md diff --git a/docs/getDateOfBirth().md b/docs/getDateOfBirth.md similarity index 100% rename from docs/getDateOfBirth().md rename to docs/getDateOfBirth.md diff --git a/docs/getDistanceCycling().md b/docs/getDistanceCycling.md similarity index 100% rename from docs/getDistanceCycling().md rename to docs/getDistanceCycling.md diff --git a/docs/getDistanceWalkingRunning().md b/docs/getDistanceWalkingRunning.md similarity index 100% rename from docs/getDistanceWalkingRunning().md rename to docs/getDistanceWalkingRunning.md diff --git a/docs/getFlightsClimbed().md b/docs/getFlightsClimbed.md similarity index 100% rename from docs/getFlightsClimbed().md rename to docs/getFlightsClimbed.md diff --git a/docs/getHeartRateSamples().md b/docs/getHeartRateSamples.md similarity index 100% rename from docs/getHeartRateSamples().md rename to docs/getHeartRateSamples.md diff --git a/docs/getHeartRateVariabilitySamples().md b/docs/getHeartRateVariabilitySamples.md similarity index 100% rename from docs/getHeartRateVariabilitySamples().md rename to docs/getHeartRateVariabilitySamples.md diff --git a/docs/getHeightSamples().md b/docs/getHeightSamples.md similarity index 100% rename from docs/getHeightSamples().md rename to docs/getHeightSamples.md diff --git a/docs/getLatestBloodAlcoholContent().md b/docs/getLatestBloodAlcoholContent.md similarity index 100% rename from docs/getLatestBloodAlcoholContent().md rename to docs/getLatestBloodAlcoholContent.md diff --git a/docs/getLatestBmi().md b/docs/getLatestBmi.md similarity index 100% rename from docs/getLatestBmi().md rename to docs/getLatestBmi.md diff --git a/docs/getLatestBodyFatPercentage().md b/docs/getLatestBodyFatPercentage.md similarity index 100% rename from docs/getLatestBodyFatPercentage().md rename to docs/getLatestBodyFatPercentage.md diff --git a/docs/getLatestHeight().md b/docs/getLatestHeight.md similarity index 100% rename from docs/getLatestHeight().md rename to docs/getLatestHeight.md diff --git a/docs/getLatestLeanBodyMass().md b/docs/getLatestLeanBodyMass.md similarity index 100% rename from docs/getLatestLeanBodyMass().md rename to docs/getLatestLeanBodyMass.md diff --git a/docs/getLatestWeight().md b/docs/getLatestWeight.md similarity index 100% rename from docs/getLatestWeight().md rename to docs/getLatestWeight.md diff --git a/docs/getLeanBodyMassSamples().md b/docs/getLeanBodyMassSamples.md similarity index 100% rename from docs/getLeanBodyMassSamples().md rename to docs/getLeanBodyMassSamples.md diff --git a/docs/getMindfulSession().md b/docs/getMindfulSession.md similarity index 100% rename from docs/getMindfulSession().md rename to docs/getMindfulSession.md diff --git a/docs/getRespiratoryRateSamples().md b/docs/getRespiratoryRateSamples.md similarity index 100% rename from docs/getRespiratoryRateSamples().md rename to docs/getRespiratoryRateSamples.md diff --git a/docs/getRestingHeartRateSamples().md b/docs/getRestingHeartRateSamples.md similarity index 100% rename from docs/getRestingHeartRateSamples().md rename to docs/getRestingHeartRateSamples.md diff --git a/docs/getSamples().md b/docs/getSamples.md similarity index 100% rename from docs/getSamples().md rename to docs/getSamples.md diff --git a/docs/getSleepSamples().md b/docs/getSleepSamples.md similarity index 100% rename from docs/getSleepSamples().md rename to docs/getSleepSamples.md diff --git a/docs/getStepCount().md b/docs/getStepCount.md similarity index 100% rename from docs/getStepCount().md rename to docs/getStepCount.md diff --git a/docs/getVo2MaxSamples().md b/docs/getVo2MaxSamples.md similarity index 100% rename from docs/getVo2MaxSamples().md rename to docs/getVo2MaxSamples.md diff --git a/docs/getWeightSamples().md b/docs/getWeightSamples.md similarity index 100% rename from docs/getWeightSamples().md rename to docs/getWeightSamples.md diff --git a/docs/getWorkout.md b/docs/getWorkout.md new file mode 100644 index 00000000..298c9c4e --- /dev/null +++ b/docs/getWorkout.md @@ -0,0 +1,3 @@ +# Get Workout + +> Oops! Seems that we don't have documentation for this method yet. Feel free to contribute opening a new PR diff --git a/docs/initHealthKit().md b/docs/initHealthKit.md similarity index 100% rename from docs/initHealthKit().md rename to docs/initHealthKit.md diff --git a/docs/initStepCountObserver().md b/docs/initStepCountObserver.md similarity index 100% rename from docs/initStepCountObserver().md rename to docs/initStepCountObserver.md diff --git a/docs/isAvailable().md b/docs/isAvailable.md similarity index 100% rename from docs/isAvailable().md rename to docs/isAvailable.md diff --git a/docs/observers.md b/docs/observers.md new file mode 100644 index 00000000..2a8e0d8c --- /dev/null +++ b/docs/observers.md @@ -0,0 +1,13 @@ +# Observers + +The following observer types are supported by the library + +``` + Cycling + HeartRate + RestingHeartRate + Running + StairClimbing + Walking + Workout +``` diff --git a/docs/permissions.md b/docs/permissions.md new file mode 100644 index 00000000..5991ff34 --- /dev/null +++ b/docs/permissions.md @@ -0,0 +1,126 @@ +# Permissions + +These permissions are exported as constants of the `react-native-health` module. + +```typescript +import AppleHealthKit, { HealthValue, HealthKitPermissions } from 'react-native-health'; + +/* Permission options */ +const permissions = { + permissions: { + read: [ + AppleHealthKit.Constants.Permissions.HeartRate, + ], + write: [ + AppleHealthKit.Constants.Permissions.Steps, + ], + } +} as HealthKitPermissions + + +AppleHealthKit.initHealthKit(permissions, (error: string) => { + /* Called after we receive a response from the system */ +``` + +## Available Permissions + +``` + ActiveEnergyBurned + AppleExerciseTime + BasalEnergyBurned + BiologicalSex + BloodAlcoholContent + BloodGlucose + BloodPressureDiastolic + BloodPressureSystolic + BodyFatPercentage + BodyMass + BodyMassIndex + BodyTemperature + DateOfBirth + Biotin + Caffeine + Calcium + Carbohydrates + Chloride + Cholesterol + Copper + EnergyConsumed + FatMonounsaturated + FatPolyunsaturated + FatSaturated + FatTotal + Fiber + Folate + Iodine + Iron + Magnesium + Manganese + Molybdenum + Niacin + PantothenicAcid + Phosphorus + Potassium + Protein + Riboflavin + Selenium + Sodium + Sugar + Thiamin + VitaminA + VitaminB12 + VitaminB6 + VitaminC + VitaminD + VitaminE + VitaminK + Zinc + Water + DistanceCycling + DistanceWalkingRunning + FlightsClimbed + HeartRate + RestingHeartRate + HeartRateVariability + Height + LeanBodyMass + MindfulSession + NikeFuel + RespiratoryRate + SleepAnalysis + StepCount + Steps + Vo2Max + Weight + Workout +``` + +## Supported Apple Permissions + +The available Healthkit identifiers are supported + +| Permission | Healthkit Identifier Type | Read | Write | +|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|-------| +| ActiveEnergyBurned | [HKQuantityTypeIdentifierActiveEnergyBurned](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615771-activeenergyburned?language=objc) | ✓ | | +| BasalEnergyBurned | [HKQuantityTypeIdentifierBasalEnergyBurned](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615512-basalenergyburned?language=objc) | ✓ | | +| BiologicalSex | [HKCharacteristicTypeIdentifierBiologicalSex](https://developer.apple.com/reference/Healthkit/hkcharacteristictypeidentifierbiologicalsex?language=objc) | ✓ | | +| BloodAlcoholContent | [HKQuantityTypeIdentifierBloodAlcoholContent](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbloodalcoholcontent?language=objc) | ✓ | ✓ | +| BloodGlucose | [HKQuantityTypeIdentifierBloodGlucose](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbloodglucose?language=objc) | ✓ | | +| BloodPressureDiastolic | [HKQuantityTypeIdentifierBloodPressureDiastolic](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodpressurediastolic?language=objc) | ✓ | ✓ | +| BloodPressureSystolic | [HKQuantityTypeIdentifierBloodPressureSystolic](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodpressuresystolic?language=objc) | ✓ | ✓ | +| BodyMassIndex | [HKQuantityTypeIdentifierBodyMassIndex](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodymassindex?language=objc) | ✓ | ✓ | +| BodyTemperature | [HKQuantityTypeIdentifierBodyTemperature](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodytemperature?language=objc) | ✓ | | +| DateOfBirth | [HKCharacteristicTypeIdentifierDateOfBirth](https://developer.apple.com/reference/Healthkit/hkcharacteristictypeidentifierdateofbirth?language=objc) | ✓ | | +| DistanceCycling | [HKQuantityTypeIdentifierDistanceCycling](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierdistancecycling?language=objc) | ✓ | ✓ | +| DistanceWalkingRunning | [HKQuantityTypeIdentifierDistanceWalkingRunning](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierdistancewalkingrunning?language=objc) | ✓ | ✓ | +| FlightsClimbed | [HKQuantityTypeIdentifierFlightsClimbed](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierflightsclimbed?language=objc) | ✓ | ✓ | +| HeartRate | [HKQuantityTypeIdentifierHeartRate](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierheartrate?language=objc) | ✓ | | +| Height | [HKQuantityTypeIdentifierHeight](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierheight?language=objc) | ✓ | ✓ | +| LeanBodyMass | [HKQuantityTypeIdentifierLeanBodyMass](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierleanbodymass?language=objc) | ✓ | ✓ | +| MindfulSession | [HKCategoryTypeIdentifierMindfulSession](https://developer.apple.com/reference/healthkit/hkcategorytypeidentifiermindfulsession?language=objc) | | ✓ | +| RespiratoryRate | [HKQuantityTypeIdentifierRespiratoryRate](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierrespiratoryrate?language=objc) | ✓ | | +| SleepAnalysis | [HKCategoryTypeIdentifierSleepAnalysis](https://developer.apple.com/reference/Healthkit/hkcategorytypeidentifiersleepanalysis?language=objc) | ✓ | | +| StepCount | [HKQuantityTypeIdentifierStepCount](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierstepcount?language=objc) | ✓ | ✓ | +| Steps | [HKQuantityTypeIdentifierSteps](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifiersteps?language=objc) | ✓ | ✓ | +| Weight | [HKQuantityTypeIdentifierBodyMass](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodymass?language=objc) | ✓ | ✓ | +| BodyFatPercentage | [HKQuantityTypeIdentifierBodyFatPercentage](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodyfatpercentage?language=objc) | ✓ | ✓ | diff --git a/docs/saveBloodAlcoholContent.md b/docs/saveBloodAlcoholContent.md new file mode 100644 index 00000000..8a50875b --- /dev/null +++ b/docs/saveBloodAlcoholContent.md @@ -0,0 +1,4 @@ +# Save BloodAlcoholContent + +> Oops! Seems that we don't have documentation for this method yet. Feel free to contribute opening a new PR + diff --git a/docs/saveBloodGlucoseSample.md b/docs/saveBloodGlucoseSample.md new file mode 100644 index 00000000..221ccae5 --- /dev/null +++ b/docs/saveBloodGlucoseSample.md @@ -0,0 +1,5 @@ +# Save BloodGlucoseContent + +> Oops! Seems that we don't have documentation for this method yet. Feel free to contribute opening a new PR + + diff --git a/docs/saveBmi().md b/docs/saveBmi.md similarity index 100% rename from docs/saveBmi().md rename to docs/saveBmi.md diff --git a/docs/saveBodyFatPercentage().md b/docs/saveBodyFatPercentage.md similarity index 100% rename from docs/saveBodyFatPercentage().md rename to docs/saveBodyFatPercentage.md diff --git a/docs/saveFood.md b/docs/saveFood.md new file mode 100644 index 00000000..2fbe6adb --- /dev/null +++ b/docs/saveFood.md @@ -0,0 +1,3 @@ +# Save Food + +> Oops! Seems that we don't have documentation for this method yet. Feel free to contribute opening a new PR diff --git a/docs/saveHeight().md b/docs/saveHeight.md similarity index 100% rename from docs/saveHeight().md rename to docs/saveHeight.md diff --git a/docs/saveLeanBodyMass().md b/docs/saveLeanBodyMass.md similarity index 100% rename from docs/saveLeanBodyMass().md rename to docs/saveLeanBodyMass.md diff --git a/docs/saveMindfulSession().md b/docs/saveMindfulSession.md similarity index 100% rename from docs/saveMindfulSession().md rename to docs/saveMindfulSession.md diff --git a/docs/saveSteps().md b/docs/saveSteps.md similarity index 100% rename from docs/saveSteps().md rename to docs/saveSteps.md diff --git a/docs/saveWater.md b/docs/saveWater.md new file mode 100644 index 00000000..106e8cfa --- /dev/null +++ b/docs/saveWater.md @@ -0,0 +1,3 @@ +# Save Water + +> Oops! Seems that we don't have documentation for this method yet. Feel free to contribute opening a new PR diff --git a/docs/saveWeight().md b/docs/saveWeight.md similarity index 100% rename from docs/saveWeight().md rename to docs/saveWeight.md diff --git a/docs/saveWorkout.md b/docs/saveWorkout.md new file mode 100644 index 00000000..9b3c8cd5 --- /dev/null +++ b/docs/saveWorkout.md @@ -0,0 +1,3 @@ +# Save Workout + +> Oops! Seems that we don't have documentation for this method yet. Feel free to contribute opening a new PR diff --git a/docs/setObserver().md b/docs/setObserver.md similarity index 100% rename from docs/setObserver().md rename to docs/setObserver.md diff --git a/docs/units.md b/docs/units.md new file mode 100644 index 00000000..3ea8522b --- /dev/null +++ b/docs/units.md @@ -0,0 +1,27 @@ +# Units + +The following units are supported by the library + +``` + bpm + calorie + celsius + count + day + fahrenheit + foot + gram + hour + inch + joule + meter + mgPerdL + mile + minute + mmhg + mmolPerL + percent + pound + second + mlPerKgMin +```