Skip to content

Colota - Android GPS Location tracker

fix: send actual device coordinates in test connection instead of hardcoded values

Max Dietrich6d8d3846f265
diff --git a/src/screens/SettingsScreen.tsx b/src/screens/SettingsScreen.tsx
index e740edc4..ca906c78 100644
--- a/src/screens/SettingsScreen.tsx
+++ b/src/screens/SettingsScreen.tsx
@@ -274,11 +274,19 @@ export function SettingsScreen({ navigation }: ScreenProps) {
setTestError(false);
try {
+ const recentLocation =
+ await NativeLocationService.getMostRecentLocation();
+ if (!recentLocation) {
+ setTestResponse("No location available yet. Start tracking first.");
+ setTestError(true);
+ return;
+ }
+
const fieldMap = settings.fieldMap;
const payload: Record<string, number | boolean> = {
- [fieldMap.lat]: 1,
- [fieldMap.lon]: 1,
- [fieldMap.acc]: 1,
+ [fieldMap.lat]: recentLocation.latitude,
+ [fieldMap.lon]: recentLocation.longitude,
+ [fieldMap.acc]: recentLocation.accuracy,
};
if (fieldMap.alt) payload[fieldMap.alt] = 0;