···1import {useCallback, useEffect, useRef} from 'react'
2+import {Platform} from 'react-native'
3import * as Location from 'expo-location'
4import {createPermissionHook} from 'expo-modules-core'
5···58 })
59 const location = locations.at(0)
60 const normalized = location ? normalizeDeviceLocation(location) : undefined
61+ if (normalized?.regionCode && normalized.regionCode.length > 5) {
62+ /*
63+ * We want short codes only, and we're still seeing some full names here.
64+ * 5 is just a heuristic for a region that is probably not formatted as a
65+ * short code.
66+ */
67+ logger.error('getDeviceGeolocation: invalid regionCode', {
68+ os: Platform.OS,
69+ version: Platform.Version,
70+ regionCode: normalized.regionCode,
71+ })
72+ }
73 return {
74 countryCode: normalized?.countryCode ?? undefined,
75 regionCode: normalized?.regionCode ?? undefined,