Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cristianszwarc/RNDeviceAngles
https://github.com/cristianszwarc/RNDeviceAngles
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cristianszwarc/RNDeviceAngles
- Owner: cristianszwarc
- License: mit
- Created: 2016-08-19T23:57:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-17T22:13:26.000Z (about 5 years ago)
- Last Synced: 2024-11-05T00:52:24.616Z (about 1 month ago)
- Language: Objective-C
- Size: 164 KB
- Stars: 14
- Watchers: 1
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-react-native - react-native-device-angles ★12 - Get rotation information in degrees (pitch, yaw, roll) - ios (Components / System)
- awesome-react-native - react-native-device-angles ★12 - Get rotation information in degrees (pitch, yaw, roll) - ios (Components / System)
- awesome-react-native - react-native-device-angles ★12 - Get rotation information in degrees (pitch, yaw, roll) - ios (Components / System)
- awesome-react-native - react-native-device-angles ★12 - Get rotation information in degrees (pitch, yaw, roll) - ios (Components / System)
- awesome-react-native-ui - react-native-device-angles ★3 - Get rotation information in degrees (pitch, yaw, roll) - ios (Components / System)
README
# React Native - Device Angles
-------------------------------
Get rotation information (pitch, yaw, roll) - ios## Getting started
`$ npm install react-native-device-angles --save`
or
`$ yarn add react-native-device-angles`
### Mostly automatic installation ( react-native < 0.60 )
`$ react-native link react-native-device-angles`
### Manual installation
#### iOS
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-device-angles` and add `DeviceAngles.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libDeviceAngles.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<## Usage
```javascript
import { DeviceEventEmitter } from 'react-native';
import DeviceAngles from 'react-native-device-angles';DeviceAngles.setDeviceMotionUpdateInterval(0.1);
...
DeviceAngles.startMotionUpdates();
...
DeviceEventEmitter.addListener('AnglesData', function (data) {
console.log(data.pitch);
console.log(data.roll);
console.log(data.yaw);
});
```**Log**
0.1.0 updated import statement by srt0422
0.1.2 Support for react-native 0.60+**ToDo**
improve this readme**Screens**
![example](screens/example.png)
**License**
MIT