react-native-health
react-native-health copied to clipboard
Background Observers Issue
Describe the bug No listeners registered warnings when listeners are registered.
To Reproduce
- Follow steps described here: https://github.com/agencyenterprise/react-native-health/blob/master/docs/background.md
- Implement listeners with following types: 'healthKit:StepCount:setup:success', 'healthKit:StepCount:setup:failure', 'healthKit:StepCount:new'
Expected behavior Listeners work correctly
Screenshots
Listeners do not work. Getting warning messages (see screenshot)
Smartphone (please complete the following information):
-
Device: iPhone11
-
OS: IOS 15.0
-
Version: 1.12.0
Additional context Add any other context about the problem here.
same issue here
same issue here
Getting the issue here also, did any of you find a solution?
Same thing here!
Same here! Anyone find a solution?
Same here!
I'm on version 1.13.0 RN: 67.4 R: 17.0.2
does anyone found solution for this?
NativeAppEventEmitter
is deprecated and is causing this issue, we just updated the Background Observers documentation with new instructions.
Adding a listener with NativeEventEmitter(NativeModules.AppleHealthKit).addListener(...)
should solve this issue.
new NativeEventEmitter(NativeModules.AppleHealthKit).addListener(
'healthKit:HeartRate:new',
async () => {
console.log('--> observer triggered');
},
);