i use rn-apple-healthkit to provide health service in my app, i setup observer and it work fine and updated after change on step, but when i back from background and tap reload button which it execute a function to get last step data it doesn't work immediately. thanks.
here is my file which i try to get latest update
AppleHealthKit.initStepCountObserver({}, () => {});const getCurrentStep = useCallback( () => { let stepCount = { date: moment().toISOString() }; AppleHealthKit.getStepCount(stepCount, (err, results) => { if (err) { console.log(err); setAnimatedStep(0); return; } setAnimatedStep(results.value); }); }, [animatedStep] );