vnil / react-native-simple-compass Goto Github PK
View Code? Open in Web Editor NEWReact Native module for iOS used to receive the phones heading
License: MIT License
React Native module for iOS used to receive the phones heading
License: MIT License
When I compare with a real compass I see different values.
There is no "calibrate" so I cannot get the true north. How can that be corrected?
In order to check whether the user needs to recalibrate the compass or not, it would be nice to get some information about the accuracy of the measurements.
It seems likenewHeading.headingAccuracy
on iOS and public void onAccuracyChanged(Sensor sensor, int accuracy)
on Android are the ways to get the accuracy. This could for instance be sent as a second parameter in the event handler callback: RNSimpleCompass.start(degree_update_rate, (degree, accuracy) => { ...
A problem is that "accuracy" is not the same thing on iOS and Android... Android uses four integer values, while on iOS uses floating point values that might be negative.
An alternative to getting the accuracy value is to dispatch an event when the compass is giving an invalid value, and will probably need calibration. This is when the accuracy is negative on iOS or 0 on Android.
What do you think?
Working on a side project with react native that uses this project. I'm new to working with RN so apologies if the answer is obvious.
After following the setup instructions (running react-native-simple-compass --save
and react-native link
) I encounter the following error when importing RNSimpleCompass
:
undefined is not an object (evaluating 'RNSimpleCompass.start')
I'm using React Native 0.49.3 with ViroReact. Has anyone else encountered this issue?
No podspec found for react-native-simple-compass
in ../node_modules/react-native-simple-compass
The example code under the Usage section simply doesn't log to the console
Hi,
thank you for this package, it worked well on react 0.59, but on react 0.60.4 i have this error when I archive with xcode :
React/RCTBridgeModule.h' file not found
Do you have any idea how i can fix this ? i have been struggling with it for days, this package is vital for my app.
Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.