react-native-fit-kit

A react native package that allows you to connect google fit and apple health kit

Usage no npm install needed!

<script type="module">
  import reactNativeFitKit from 'https://cdn.skypack.dev/react-native-fit-kit';
</script>

README

react-native-fit-kit

A react native package that allows you to connect google fit and apple health kit

android Available
android Coming soon
---------

Installation

npm install react-native-fit-kit

yarn add react-native-fit-kit

Usage

import FitKit from "react-native-fit-kit";

  //ask for permissions 
  async function connectGoogleFit() {

    try {

      const hasPermissions = await FitKit.isGoogleFitPermissionGranted();

      if (hasPermissions === false) {

        const response = await FitKit.requestGoogleFitPermission();

        console.log(response);

      } else {
        console.log('already logged in');
      }

    } catch (e) {
      console.error(e);
    }

    //inserting new workout sessions
    const results = await FitKit.insertSession('SessionName', 'identifier', FitKit.BOXING, workoutStartTimeInMs, workoutEndTimeInMs);

Contributing

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

License

MIT