-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Comments
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 |
Would you mind sending a pull request? |
Is a patch file sufficient? |
If someone wants to grab the patch and send the pull request, sure. We need someone to propose and support the change. |
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. |
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
The text was updated successfully, but these errors were encountered: