Skip to content

Commit

Permalink
Commit screenshot and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
paramaggarwal committed Aug 27, 2015
1 parent 823dc59 commit e02afd8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# 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
Binary file added Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e02afd8

Please sign in to comment.