I am trying to use a nested async/ await to get location details. However, I get the following error:
RNGeocoder.geocodePosition was called with 1 arguments but expects 3 arguments. If you haven’t changed this method yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
Can anyone help?
const getRescueMeLocationDetails = async (location) => {
Geocoder.geocodePosition({
lat: location.latitude,
lng: location.longitude,
})
.then((res) => {
return res;
})
.catch((err) => console.log(err));
};
const locateMe = async () => {
const isGranted = await getLocationPermissions();
setPermissionGranted(!!isGranted);
if (isGranted) {
Geolocation.getCurrentPosition(async (info) => {
const lat = info.coords.latitude;
const long = info.coords.longitude;
const initialRegion = {
latitude: lat,
longitude: long,
};
const results = await getRescueMeLocationDetails(initialRegion);
setLocation({ ...initialRegion, results });
});
}
};