Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

rn-apple-healthkit doesn't update immediately after coming back from background

$
0
0

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]  );

Viewing all articles
Browse latest Browse all 16552

Trending Articles