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

bug in RCTLocationObserver.m #23148

Closed
mo22 opened this issue Jan 24, 2019 · 7 comments
Closed

bug in RCTLocationObserver.m #23148

mo22 opened this issue Jan 24, 2019 · 7 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@mo22
Copy link

mo22 commented Jan 24, 2019

Environment

React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
Memory: 1.01 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.7.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 25, 27, 28
Build Tools: 27.0.3, 28.0.3
System Images: android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.7.0 => 16.7.0
react-native: 0.58 => 0.58
npmGlobalPackages:
react-native-cli: 2.0.1

Description

Hi,

related to #17145

The part if (ABS(_locationManager.desiredAccuracy - RCT_DEFAULT_LOCATION_ACCURACY) > 0.000001) { on line ~ 360 of RCTLocationObserver.m always resets the location accuracy to the default value.

It should rather check if _observingLocation is true and use _observerOptions.accuracy instead, like this:

if (_observingLocation && ABS(_locationManager.desiredAccuracy - _observerOptions.accuracy) > 0.000001) { _locationManager.desiredAccuracy = _observerOptions.accuracy; } if (!_observingLocation && ABS(_locationManager.desiredAccuracy - RCT_DEFAULT_LOCATION_ACCURACY) > 0.000001) { _locationManager.desiredAccuracy = RCT_DEFAULT_LOCATION_ACCURACY; }

Cheers and thanks for the great work!

Reproducible Demo

n/a

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.58 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@hramos
Copy link
Contributor

hramos commented Jan 29, 2019

Would you mind sending a pull request?

@mo22
Copy link
Author

mo22 commented Jan 29, 2019

Is a patch file sufficient?

react-native+0.58.1.patch.txt

@hramos
Copy link
Contributor

hramos commented Jan 29, 2019

If someone wants to grab the patch and send the pull request, sure. We need someone to propose and support the change.

@mo22
Copy link
Author

mo22 commented Jan 29, 2019

#23207

@alloy
Copy link
Contributor

alloy commented Mar 19, 2019

Hey there 👋 Thanks for taking the time to create a patch! However, seeing as you did create a PR for this that ended up not being merged, and in an effort to reduce the noise in the issue tracker, I’m going to close this issue as well. When/if somebody else runs into the same issue, they can champion it through.

@alloy alloy closed this as completed Mar 19, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants