Background location tracking
This commit is contained in:
@@ -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',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user