setObserver().md 533 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Will listen for any updates in a given type data in healthKit and call app.

type - one of the `['Walking', 'StairClimbing', 'Running', 'Cycling', 'Workout']`
```javascript 1.8
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.