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 */
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
The available Healthkit identifiers are supported