Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeModules.SensorManger is undefined #24

Open
FezVrasta opened this issue Oct 24, 2016 · 2 comments
Open

NativeModules.SensorManger is undefined #24

FezVrasta opened this issue Oct 24, 2016 · 2 comments

Comments

@FezVrasta
Copy link

FezVrasta commented Oct 24, 2016

I followed the steps, ran react-native run-android, but when I call NativeModules.SensorManager, it's undefined.

Ideas?

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

const mSensorManager = NativeModules.SensorManager;

mSensorManager.startLightSensor(100);
DeviceEventEmitter.addListener('LightSensor', ({ light }) => {
  console.log(light);
});
@FezVrasta
Copy link
Author

I fixed it with these steps:

#12 (comment)

maybe update the readme?

@ancodeUDW
Copy link

didn't solve the problem in my case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants