Skip to content

firofame/react-native-compass-heading

Repository files navigation

react-native-compass-heading

React Native module for iOS & Android to receive compass heading

Installation

yarn add install react-native-compass-heading

Usage

import CompassHeading from 'react-native-compass-heading';

  React.useEffect(() => {
    const degree_update_rate = 3;

    CompassHeading.start(degree_update_rate, ({heading, accuracy}) => {
      console.log('CompassHeading: ', heading, accuracy);
    });

    return () => {
      CompassHeading.stop();
    };
  }, []);

Contributing

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

License

MIT


Made with create-react-native-library