I am using react-native 0.59, then updated the API to 29. Changing 29, the 'Allow all the time' was removed in the option list upon requesting for location permission.
Then, I created a bridge for the location permission. Because some articles, stated that I need to list the option manually.
int permissionCheck = ContextCompat.checkSelfPermission(this.getReactApplicationContext(),
Manifest.permission.ACCESS_BACKGROUND_LOCATION);
if (permissionCheck == PackageManager.PERMISSION_GRANTED) {
promise.resolve(true);
} else {
// Intent i = new Intent(mClass.this, GeoLocationService.class);
final Activity activity = getCurrentActivity();
ActivityCompat.requestPermissions(
activity,
new String[]{
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION
},
MY_PERMISSIONS_REQUEST_LOCATION
);
promise.resolve(false);
}
It is working. But on debug mode it prompts once, but on release mode it prompts twice.
Thanks for your response!