0.1.7 • Published 5 months ago

react-native-healthkitty v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-native-healthkitty

Generated with https://github.com/react-native-community/bob

React Native HealthKit integration. Works for Android and iOS.

Installation

npm install react-native-healthkitty

Usage

import Healthkitty from 'react-native-healthkitty';

// ...
try {
  return Healthkitty.isAuthorized(permissions)
    .then((authResult) => {
      Alert.alert('Auth Result', authResult);
    })
    .catch((e) => {
      Alert.alert('Auth Error', JSON.stringify(e));
    });
} catch (e) {
  console.log(e);
}

try {
  const now = new Date().getTime();
  const hr = await Healthkitty.queryHeartRate(
    subWeeks(startOfDay(now), 1).getTime(),
    now,
    5
  );
} catch (e) {
  console.error(e);
}

Example

Check example folder in order to know how to use this library.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.1.7

5 months ago

0.1.6

5 months ago

0.1.5

6 months ago