Provides access to a hardware device's accelerometer, gyroscope, magnetometer, and pedometer.
This package is pre-installed in managed Expo projects. You may skip the rest of the installation guide if this applies to you.
For bare React Native projects, you must ensure that you have installed and configured the
react-native-unimodules package before continuing.
Add the package to your npm dependencies
npm install expo-sensors
Configure for iOS
pod install in the ios directory after installing the npm package.
Note: to access DeviceMotion stats on iOS, the NSMotionUsageDescription key must be present in your Info.plist.
Configure for Android
No additional set up necessary.
Contributions are very welcome! Please refer to guidelines described in the contributing guide.