You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{PERMISSIONS,requestMultiple}from'react-native-permissions';awaitrequestMultiple([// Requesting both as doc https://developer.android.com/develop/sensors-and-location/location/permissions#approximate-requestPERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION,PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION,]);constresult=multipleResult?.[PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION];console.log(`Did grant at least approx location: ${result==='granted'}`)// Result will be granted for either ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION
Tried passing enableHighAccuracy: false, but didn't help. If ACCESS_FINE_LOCATION permission is granted, then getCurrentPosition returns the position correctly.
The text was updated successfully, but these errors were encountered:
Environment
System:
OS: macOS 14.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 111.42 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.1.0
path: /opt/homebrew/bin/node
Yarn:
version: 1.22.22
path: ~/.nvm/versions/node/v21.7.1/bin/yarn
npm:
version: 10.7.0
path: /opt/homebrew/bin/npm
Watchman:
version: 2024.05.06.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK: Not Found
IDEs:
Android Studio: 2023.2 AI-232.10227.8.2321.11479570
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.11
wanted: 0.72.11
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: false
newArchEnabled: false
Platforms
Android
Versions
Description
When giving only approximate location permission (ACCESS_COARSE_LOCATION)
getCurrentPosition
returns error:Reproducible Demo
Request permission with
react-native-permissions
:Get location:
Tried passing
enableHighAccuracy: false
, but didn't help. If ACCESS_FINE_LOCATION permission is granted, thengetCurrentPosition
returns the position correctly.The text was updated successfully, but these errors were encountered: