Skip to content

Latest commit

 

History

History
161 lines (151 loc) · 10.4 KB

permissions.md

File metadata and controls

161 lines (151 loc) · 10.4 KB

Permissions

These permissions are exported as constants of the react-native-health module.

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
  ActivitySummary
  AllergyRecord
  AppleExerciseTime
  AppleStandTime
  BasalEnergyBurned
  BiologicalSex
  BloodType
  BloodAlcoholContent
  BloodGlucose
  BloodPressureDiastolic
  BloodPressureSystolic
  BodyFatPercentage
  BodyMass
  BodyMassIndex
  BodyTemperature
  DateOfBirth
  Biotin
  Caffeine
  Calcium
  Carbohydrates
  Chloride
  Cholesterol
  ConditionRecord
  Copper
  CoverageRecord
  Electrocardiogram
  EnergyConsumed
  EnvironmentalAudioExposure
  FatMonounsaturated
  FatPolyunsaturated
  FatSaturated
  FatTotal
  Fiber
  Folate
  HeadphoneAudioExposure
  ImmunizationRecord
  Iodine
  Iron
  LabResultRecord
  Magnesium
  Manganese
  MedicationRecord
  Molybdenum
  Niacin
  PantothenicAcid
  Phosphorus
  Potassium
  ProcedureRecord
  Protein
  Riboflavin
  Selenium
  Sodium
  Sugar
  Thiamin
  VitaminA
  VitaminB12
  VitaminB6
  VitaminC
  VitaminD
  VitaminE
  VitaminK
  Zinc
  Water
  DistanceCycling
  DistanceSwimming
  DistanceWalkingRunning
  FlightsClimbed
  HeartbeatSeries
  HeartRate
  RestingHeartRate
  HeartRateVariability
  Height
  LeanBodyMass
  MindfulSession
  NikeFuel
  RespiratoryRate
  SleepAnalysis
  StepCount
  Steps
  VitalSignRecord
  Vo2Max
  WalkingHeartRateAverage
  Weight
  Workout
  PeakFlow

Supported Apple Permissions

The available Healthkit identifiers are supported

Permission Healthkit Identifier Type Read Write
ActiveEnergyBurned HKQuantityTypeIdentifierActiveEnergyBurned
ActivitySummary HKActivitySummaryType
AllergyRecord HKClinicalTypeIdentifierAllergyRecord
BasalEnergyBurned HKQuantityTypeIdentifierBasalEnergyBurned
BiologicalSex HKCharacteristicTypeIdentifierBiologicalSex
BloodType HKCharacteristicTypeIdentifierBloodType
BloodAlcoholContent HKQuantityTypeIdentifierBloodAlcoholContent
BloodGlucose HKQuantityTypeIdentifierBloodGlucose
BloodPressureDiastolic HKQuantityTypeIdentifierBloodPressureDiastolic
BloodPressureSystolic HKQuantityTypeIdentifierBloodPressureSystolic
BodyFatPercentage HKQuantityTypeIdentifierBodyFatPercentage
BodyMassIndex HKQuantityTypeIdentifierBodyMassIndex
BodyTemperature HKQuantityTypeIdentifierBodyTemperature
ConditionRecord HKClinicalTypeIdentifierConditionRecord
CoverageRecord HKClinicalTypeIdentifierCoverageRecord
DateOfBirth HKCharacteristicTypeIdentifierDateOfBirth
DistanceCycling HKQuantityTypeIdentifierDistanceCycling
DistanceWalkingRunning HKQuantityTypeIdentifierDistanceWalkingRunning
Electrocardiogram HKObjectType.electrocardiogramType
EnvironmentalAudioExposure HKQuantityTypeIdentifierEnvironmentalAudioExposure
FlightsClimbed HKQuantityTypeIdentifierFlightsClimbed
HeadphoneAudioExposure HKQuantityTypeIdentifierHeadphoneAudioExposure
HeartbeatSeries HKDataTypeIdentifierHeartbeatSeries
HeartRate HKQuantityTypeIdentifierHeartRate
Height HKQuantityTypeIdentifierHeight
ImmunizationRecord HKClinicalTypeIdentifierImmunizationRecord
LabResultRecord HKClinicalTypeIdentifierLabResultRecord
LeanBodyMass HKQuantityTypeIdentifierLeanBodyMass
MindfulSession HKCategoryTypeIdentifierMindfulSession
MedicationRecord HKClinicalTypeIdentifierMedicationRecord
ProcedureRecord HKClinicalTypeIdentifierProcedureRecord
RespiratoryRate HKQuantityTypeIdentifierRespiratoryRate
SleepAnalysis HKCategoryTypeIdentifierSleepAnalysis
StepCount HKQuantityTypeIdentifierStepCount
Steps HKQuantityTypeIdentifierSteps
VitalSignRecord HKClinicalTypeIdentifierVitalSignRecord
Weight HKQuantityTypeIdentifierBodyMass
BodyFatPercentage HKQuantityTypeIdentifierBodyFatPercentage
WalkingHeartRateAverage HKQuantityTypeIdentifierWalkingHeartRateAverage
PeakFlow HKQuantityTypeIdentifierPeakExpiratoryFlowRate