feat: add device authentication, place gates support, and PiP navigation features

This commit is contained in:
Hamza-Ayed
2026-09-19 12:34:26 +03:00
parent 279c9fa510
commit a8470eb76c
15 changed files with 652 additions and 37 deletions
@@ -349,4 +349,35 @@ class MapSaasRepository {
return false;
}
}
/// Batch ingest multiple telemetry points in a single HTTP request (POST /api/telemetry/batch)
Future<bool> sendTelemetryBatch({
required List<Map<String, dynamic>> points,
}) async {
if (points.isEmpty) return true;
final uri = Uri.parse(ApiConstants.mapSaasTelemetryBatch);
try {
final payload = {
'points': points,
};
final response = await client.post(
uri,
headers: {
..._baseHeaders,
'Content-Type': 'application/json',
},
body: jsonEncode(payload),
);
final ok = response.statusCode == 200 || response.statusCode == 201;
if (ok) {
print("📦 [MapSaasRepo] Telemetry batch sent successfully: ${points.length} points");
} else {
print("⚠️ [MapSaasRepo] Telemetry batch HTTP ${response.statusCode}: ${response.body}");
}
return ok;
} catch (e) {
print("❌ [MapSaasRepo] sendTelemetryBatch error: $e");
return false;
}
}
}