UNPKG

1.4 kBMarkdownView Raw
1# expo-sensors
2
3Provides access to a hardware device's accelerometer, gyroscope, magnetometer, and pedometer.
4
5# API documentation
6
7- [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/sensors.md)
8- [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/sensors/)
9
10# Installation in managed Expo projects
11
12For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/sensors/).
13
14# Installation in bare React Native projects
15
16For bare React Native projects, you must ensure that you have [installed and configured the `react-native-unimodules` package](https://github.com/unimodules/react-native-unimodules) before continuing.
17
18### Add the package to your npm dependencies
19
20```
21expo install expo-sensors
22```
23
24### Configure for iOS
25
26Run `npx pod-install` after installing the npm package.
27
28**Note:** to access DeviceMotion stats on iOS, the NSMotionUsageDescription key must be present in your Info.plist.
29
30### Configure for Android
31
32No additional set up necessary.
33
34# Contributing
35
36Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).