JSPM

react-native-device-angles

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q30742F
  • License MIT

Wrapper to get rotation information (pitch, yaw, roll angles) using the gyroscope (MotionManager ios)

Package Exports

  • react-native-device-angles

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-device-angles) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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