plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[@nativescript/geolocation] Background location not working on android >=10

Open pabloposada09 opened this issue 2 years ago • 2 comments

I used the method

    geolocation.enableLocationRequest(true, true).then(() => {
      const location = geolocation.getCurrentLocation({
        desiredAccuracy: CoreTypes.Accuracy.high,
        maximumAge: 3000,
        timeout: 300000
      }).then((loc) => {
        if (loc) {
          console.log(loc);
        }
      }, (e) => {
        console.log("Error en getCurrentLocationn");
        console.log(e);
      });
    }, (e) => {
      console.log("Error en enableLocationRequest");
      console.log(e);
    });

but I'm getting this error: {"android.permission.ACCESS_BACKGROUND_LOCATION": false}. I added in the android manifest these permissions : <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />, <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> and <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> as the Readme said.

I tried using the same fuction without arguments, but it doesn't work in background neither.

So, can anyone explain if I'm doing something wrong or if this is a real bug.

pabloposada09 avatar Jul 15 '22 02:07 pabloposada09

Did you find any solution to this?

liamcharmer avatar Jul 27 '22 09:07 liamcharmer

@liamcharmer No, I didn't.

pabloposada09 avatar Jul 27 '22 16:07 pabloposada09