react-native-health
react-native-health copied to clipboard
getElectrocardiogramSamples is not a function
Hello everyone,
I'm trying to use getElectrocardiogramSamples and receiving the message 'TypeError: _reactNativeHealth.default.getElectrocardiogramSamples is not a function'
-
getOxygenSaturationSamples return a similar error mensagem.
-
getDailyStepCountSamples works fine.
-
initHealthKit return 1
-
isAvailable return true
To understand better the problem, we use getOwnPropertyNames, like this 'console.log('getOwnPropertyNames:', Object.getOwnPropertyNames(AppleHealthKit))', and return:
["isAvailable", "initHealthKit", "initStepCountObserver", "getBiologicalSex", "getDateOfBirth", "getLatestWeight", "getWeightSamples", "saveWeight", "getLatestHeight", "getHeightSamples", "saveHeight", "getLatestBmi", "saveBmi", "getLatestBodyFatPercentage", "getLatestLeanBodyMass", "getStepCount", "getSamples", "setObserver", "getDailyStepCountSamples", "saveSteps", "getDistanceWalkingRunning", "getDailyDistanceWalkingRunningSamples", "getDistanceCycling", "getDailyDistanceCyclingSamples", "getFlightsClimbed", "getDailyFlightsClimbedSamples", "saveFood", "saveWater", "getHeartRateSamples", "getActiveEnergyBurned", "getBasalEnergyBurned", "getBodyTemperatureSamples", "getBloodPressureSamples", "getRespiratoryRateSamples", "getBloodGlucoseSamples", "getSleepSamples", "getInfo", "saveMindfulSession", "getConstants", "Constants"]
We didn't find the getElectrocardiogramSamples method in the return of getOwnPropertyNames
- react-native-health version 1.10.0
Could someone help me understand why I'm getting this error? Thanks in advance!
It looks like a lot of methods are missing in your console log output. Did you use a version of this library before 1.10.0
? Can you try cleaning the build folder, then uninstall/reinstall this library before rebuilding?
Hello Klandell, thank you so much for the quick reply.
Before we were using rn-apple-healthkit, when we migrated we started with react-native-health version 1.10.0.
I've already done the clean, remove and added it to the lib, but no changes in the return of getOwnPropertyNames or error message.
Do you have any other suggestions?
Really weird indeed, looks like your lib is not updated. Don't see anything from cleaning the build again.