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
AppleExerciseTime
AppleStandTime
BasalEnergyBurned
BiologicalSex
BloodType
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
DistanceSwimming
DistanceWalkingRunning
FlightsClimbed
HeartRate
RestingHeartRate
HeartRateVariability
Height
LeanBodyMass
MindfulSession
NikeFuel
RespiratoryRate
SleepAnalysis
StepCount
Steps
Vo2Max
Weight
Workout
The available Healthkit identifiers are supported