react-native-compass-heading

Listener to device's compass information.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-native-compass-heading
107161.5.0a year ago5 years agoMinified + gzip package size for react-native-compass-heading in KB

Readme

react-native-compass-heading
React Native module for iOS & Android to receive compass heading

Installation

npm 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