Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Latest commit

 

History

History
15 lines (13 loc) · 533 Bytes

setObserver().md

File metadata and controls

15 lines (13 loc) · 533 Bytes

Will listen for any updates in a given type data in healthKit and call app.

type - one of the ['Walking', 'StairClimbing', 'Running', 'Cycling', 'Workout']

import { NativeAppEventEmitter } from 'react-native';
//...//
AppleHealthKit.setObserver({ type: 'Walking' });
NativeAppEventEmitter.addListener(
      'observer',
      callback
    );

So, callback would be call when new data of given type appears. When it happens, in order to get new info need to call getSamples() function with proper arguments.