···11import {useCallback, useEffect, useRef} from 'react'
22+import {Platform} from 'react-native'
23import * as Location from 'expo-location'
34import {createPermissionHook} from 'expo-modules-core'
45···5758 })
5859 const location = locations.at(0)
5960 const normalized = location ? normalizeDeviceLocation(location) : undefined
6161+ if (normalized?.regionCode && normalized.regionCode.length > 5) {
6262+ /*
6363+ * We want short codes only, and we're still seeing some full names here.
6464+ * 5 is just a heuristic for a region that is probably not formatted as a
6565+ * short code.
6666+ */
6767+ logger.error('getDeviceGeolocation: invalid regionCode', {
6868+ os: Platform.OS,
6969+ version: Platform.Version,
7070+ regionCode: normalized.regionCode,
7171+ })
7272+ }
6073 return {
6174 countryCode: normalized?.countryCode ?? undefined,
6275 regionCode: normalized?.regionCode ?? undefined,