Expo version 4.12.0
Platform: Android
I’m having problems with the expo-location library
I’ve run numerous tests, I can barely list them all here, but I’ve come to the conclusion that the expo-location library isn’t working on some devices like Redmi Note 7, Redmi Note 8 and Pixel 3A.
The error I get is the following, when trying to acquire the user’s position: Location request failure due to unsatisfied device settings
This happens even with the user allowing all the permissions that appear and are required.
On some devices the location works, on others it doesn’t
My code:
async function requestPermission() {
try {
let { status } = await Location.requestForegroundPermissionsAsync();
console.warn("EXPO LOCATION STATUS: ", status)
let getLocation = await Location.getCurrentPositionAsync({});
setLocation(getLocation);
const healthUnits: healthUnits[] = await mapearUnidades(getLocation as LocationCoords);
setHealthUnits(healthUnits)
setLoading(false)
} catch (err) {
console.warn(err, "here");
}
}