Agontuk / react-native-geolocation-service

React native geolocation service for iOS and android
https://www.npmjs.com/package/react-native-geolocation-service
MIT License
1.61k stars 291 forks source link

iOS: Location "always" permission incorrect #368

Closed Rc85 closed 2 years ago

Rc85 commented 2 years ago

Environment

Run npx react-native info in your terminal and copy the results here.

System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 20.25 GB / 31.93 GB
  Binaries:
    Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
    Watchman: 20210102.202219.0 - C:\Users\roger\watchman\bin\watchman.EXE
  SDKs:
    Android SDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Version     2021.1.0.0 AI-211.7628.21.2111.8309675
    Visual Studio: 15.9.28307.1401 (Visual Studio Community 2017)
  Languages:
    Java: 17.0.1 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^17.0.2 => 17.0.2
    react-native: ^0.68.0 => 0.68.2
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Platforms

Is this issue related to Android, iOS, or both ?

iOS

Versions

Please add the used versions/branches

Description

Please provide a clear and concise description of what the bug is. Include screenshots if needed.

The app's location permission is set to "When Using App" in iOS' app setting, but Geolocation.requestAuthorization shows "always" as granted.

Reproducible Demo

Provide a detailed list of steps that reproduce the issue.

  1. Add NSLocationAlwaysUsageDescription to Info.plist
  2. Build and open the app
  3. Go to app settings in iOS settings, press on location and make sure "While Using App" is checked
  4. console.log Geolocation.requestAuthorization('always')
  5. It will show "granted"

Expected Results

It should show anything other than granted

Rc85 commented 2 years ago

Using react-native-permissions will show correct permissions.