Skip to content

LackLee/RNDeviceAngles

 
 

Repository files navigation

React Native - Device Angles

Get rotation information (pitch, yaw, roll) - ios

use

react-native init myProject

cd myProject

npm install react-native-device-angles --save

configure open the xcode project from your react-native application myProject/ios/myProject.xcode

right click on Libraries then "add files" then select myProject/node_modules/react-native-device-angles/RNDeviceAngles.xcode

click on your xCode project, then select the build phases tab and inside Link Binary With Libraries add libRNDeviceAngles.a to the list

code

import { DeviceEventEmitter } from 'react-native';
import { DeviceAngles } from 'NativeModules';

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

ToDo improve this readme

Screens

example

License MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 53.4%
  • JavaScript 24.5%
  • Python 12.6%
  • Java 9.5%