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 292 forks source link

How to show "Allow all the time" option on LocationDialog on android 10 and above? #242

Closed ArchanaSharma95 closed 3 years ago

ArchanaSharma95 commented 3 years ago

According to google official document :: On Android 10 (API level 29) and higher, you must declare the ACCESS_BACKGROUND_LOCATION permission in your app's manifest in order to request background location access at runtime. On earlier versions of Android, when your app receives foreground location access, it automatically receives background location access as well.

<manifest ... >
  <!-- Required only when requesting background location access on
       Android 10 (API level 29) and higher. -->
  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
</manifest>

I did this but Not getting "Allow all the time" option inside location dialog. Please inform are providing support for android level 29 or greater? Also how do I fix this??

Agontuk commented 3 years ago

From android 11, "Allow all the time" will not be shown in permission dialog. Instead users have to go to settings and select it manually. It should work on android 10, can you share your build tools & compile sdk version ?

Agontuk commented 3 years ago

You need to also ask for ACCESS_BACKGROUND_LOCATION permission using PermissionAndroid api. Otherwise Allow all the time will not show up in android 10.