plugins
plugins copied to clipboard
[@nativescript/geolocation] Background location not working on android >=10
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.
Did you find any solution to this?
@liamcharmer No, I didn't.