My app looks up lat/long addresses using the Location package in Expo (expo-location).
Once I get the user’s permission, the device provides the lat/long coordinates. I then attempt to convert these coordinates to a UK address:
let location = await Location.getCurrentPositionAsync({});
let address = await Location.reverseGeocodeAsync(coords);
if (address[0].postalCode.length < 5) {
Alert.alert(
'Error',
'Location.reverseGeocodeAsync() returned only a partial postcode: ' + address[0].postalCode
);
}
Does anyone know why I don’t always get a full UK postcode? I’ve tested this in multiple locations on data and on WiFi, and there doesn’t seem to be a pattern as to when it fails.