diff --git a/src/pages/MapPage.tsx b/src/pages/MapPage.tsx index da077a7..6a16133 100644 --- a/src/pages/MapPage.tsx +++ b/src/pages/MapPage.tsx @@ -639,6 +639,12 @@ export default function MapPage() { setNearMeLoading(false); const kind = err instanceof GeolocationError ? err.kind : 'unavailable'; + // Raw diagnostic text so we can see exactly what failed on-device + // (no adb needed). Shown appended to the toast + logged. + const rawMsg = err instanceof Error ? err.message : String(err); + console.warn('[NearMe] geolocation failed:', kind, rawMsg, err); + const diag = rawMsg ? ` [${rawMsg}]` : ''; + if (kind === 'denied') { setNearMeError('denied'); if (isNativeGeolocation()) { @@ -646,8 +652,10 @@ export default function MapPage() { toast({ title: 'Location permission needed', description: - 'Allow location for SkateSpots in your device Settings → Apps → SkateSpots → Permissions, then tap Near Me again.', + 'Allow location for SkateSpots in your device Settings → Apps → SkateSpots → Permissions, then tap Near Me again.' + + diag, variant: 'destructive', + duration: 12000, }); } else { // Web: show the browser re-enable help sheet. @@ -657,19 +665,24 @@ export default function MapPage() { setNearMeError('timeout'); toast({ title: 'Location timed out', - description: isNativeGeolocation() - ? "Couldn't get a location fix. Make sure Location/GPS is turned on in your phone's quick settings, then tap Near Me again." - : 'Could not get your location in time. Check your signal and try again.', + description: + (isNativeGeolocation() + ? "Couldn't get a location fix. Make sure Location/GPS is turned on in your phone's quick settings, then tap Near Me again." + : 'Could not get your location in time. Check your signal and try again.') + diag, variant: 'destructive', + duration: 12000, }); } else { setNearMeError('unavailable'); toast({ title: 'Location unavailable', - description: isNativeGeolocation() - ? 'Turn on Location/GPS in your phone settings, allow location for SkateSpots (Settings → Apps → SkateSpots → Permissions), then try again.' - : 'Your location could not be determined. Make sure location services are enabled.', + description: + (isNativeGeolocation() + ? 'Turn on Location/GPS in your phone settings, allow location for SkateSpots (Settings → Apps → SkateSpots → Permissions), then try again.' + : 'Your location could not be determined. Make sure location services are enabled.') + + diag, variant: 'destructive', + duration: 12000, }); } }