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

Android returns opposite values #52

Open
jpodpro opened this issue Nov 27, 2024 · 3 comments
Open

Android returns opposite values #52

jpodpro opened this issue Nov 27, 2024 · 3 comments

Comments

@jpodpro
Copy link

jpodpro commented Nov 27, 2024

After upgrading to latest RN (0.76.3) Android returns opposite heading values, while iOS returns expected values. At 0 and 180, they are still correct but in between they point to the wrong side. For example, instead a heading of 20 it is returning 340 (or -20). As the device turns one way the indicator turns the opposite way.

@adbs1
Copy link

adbs1 commented Nov 30, 2024

Maybe not helpful, and not ideal, but this is my workaround.

if (Platform.OS === 'ios') {
result.heading = (360 - result.heading + 360) % 360;
}

I'm new to this library so wasn't sure what to expect and therefore just dealt with it. You're saying expect the same number which seems completely reasonable.

@jpodpro
Copy link
Author

jpodpro commented Dec 11, 2024

@adbs1 Are you saying you experience this too? I'm concerned because my device does it but my coworker's doesn't. I would incorporate your math fix but it doesn't appear to be all android devices...

@jpodpro
Copy link
Author

jpodpro commented Dec 16, 2024

This issue only affects some Android devices and not all. So this library is basically useless and clearly not well maintained. I recommend avoiding and using some other sensor library.

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