Background location tracking

This commit is contained in:
2026-03-09 22:33:35 +08:00
parent 1e1c7d9552
commit ccc1c62262
10 changed files with 371 additions and 127 deletions
+5 -3
View File
@@ -64,10 +64,12 @@ class WhereaboutsController {
if (userId == null) throw Exception('Not authenticated');
if (allow) {
// Ensure location permission before enabling
final granted = await ensureLocationPermission();
// Ensure foreground + background location permission before enabling
final granted = await ensureBackgroundLocationPermission();
if (!granted) {
throw Exception('Location permission is required for tracking');
throw Exception(
'Background location permission is required for tracking',
);
}
}