Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paramaggarwal/react-native-device-motion
iOS device motion wrapper for React Native.
https://github.com/paramaggarwal/react-native-device-motion
Last synced: 3 months ago
JSON representation
iOS device motion wrapper for React Native.
- Host: GitHub
- URL: https://github.com/paramaggarwal/react-native-device-motion
- Owner: paramaggarwal
- License: mit
- Created: 2015-08-27T13:45:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-27T14:27:29.000Z (over 9 years ago)
- Last Synced: 2024-10-17T16:12:32.489Z (3 months ago)
- Language: Objective-C
- Size: 328 KB
- Stars: 35
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-device-motion ★29 - iOS device motion wrapper for React Native. (Components / System)
- awesome-react-native - react-native-device-motion ★29 - iOS device motion wrapper for React Native. (Components / System)
- awesome-react-native - react-native-device-motion ★29 - iOS device motion wrapper for React Native. (Components / System)
- awesome-react-native - react-native-device-motion ★29 - iOS device motion wrapper for React Native. (Components / System)
- awesome-react-native-ui - react-native-device-motion ★25 - iOS device motion wrapper for React Native. (Components / System)
README
# react-native-device-motion
iOS device motion wrapper for React Native.Uses iOS CMMotionManager to provide device motion updates like roll, pitch, yaw and much more to your React Native app.
## Screenshot
![Screenshot of the example app](https://github.com/paramaggarwal/react-native-device-motion/raw/master/Screenshot.png)
## Usage
```javascript
// 60fps updates
DeviceMotion.startDeviceMotionUpdates(1000/60, (data) => {
console.log('Raw motion data: ', data);
});// when done,
DeviceMotion.stopDeviceMotionUpdates();
```## Properties
* `startDeviceMotionUpdates`: Pass an interval in `ms` and a callback to call with data.
* `stopDeviceMotionUpdates`: Call to stop listening for events.## Installation
Use your preferred method of including the library in your app.
## Example
Try the included example:```sh
git clone [email protected]:paramaggarwal/react-native-device-motion.git
npm install
open iOS/RNTDeviceMotion.xcodeproj
```Then `Cmd+R` to start the React Packager, build and run the project in the simulator.
## Author
Param Aggarwal ([email protected])## License
MIT License