Minor change in location getting method for Android

This commit is contained in:
Nguyen Ngo
2025-08-29 16:40:02 -04:00
parent b4fed2c9ce
commit 2ec9e4781b
+12 -23
View File
@@ -162,28 +162,6 @@ function attemptIPBasedLocation() {
// Try multiple IP geolocation services for better accuracy // Try multiple IP geolocation services for better accuracy
const ipLocationServices = [ const ipLocationServices = [
{
url: 'https://ipapi.co/json/',
parseResponse: (data) => ({
lat: data.latitude,
lng: data.longitude,
city: data.city,
region: data.region,
country: data.country_name,
accuracy: data.city ? 10000 : 50000 // Better accuracy if city is available
})
},
{
url: 'https://ip-api.com/json/',
parseResponse: (data) => ({
lat: data.lat,
lng: data.lon,
city: data.city,
region: data.regionName,
country: data.country,
accuracy: data.city ? 10000 : 50000 // Better accuracy if city is available
})
},
{ {
url: 'https://ipinfo.io/json', url: 'https://ipinfo.io/json',
parseResponse: (data) => { parseResponse: (data) => {
@@ -200,7 +178,18 @@ function attemptIPBasedLocation() {
} }
return null; return null;
} }
} },
{
url: 'https://ipapi.co/json/',
parseResponse: (data) => ({
lat: data.latitude,
lng: data.longitude,
city: data.city,
region: data.region,
country: data.country_name,
accuracy: data.city ? 10000 : 50000 // Better accuracy if city is available
})
},
]; ];
let serviceIndex = 0; let serviceIndex = 0;