background_location
0.13.2, released a year ago by faultyapp.com
A Flutter plugin to get location updates in the background for Android and iOS.
What it does
Provides background location tracking using CoreLocation on iOS and FusedLocationProvider on Android. It exposes location updates containing latitude, longitude, altitude, bearing, accuracy, speed, time, and mock status.
AI-written summary of version 0.13.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to continuously track user location even when the app is running in the background.
- Targeting both Android and iOS with native location services.
Skip it when
- You only need foreground location updates.
- You want a fully managed reactive stream library without manual service start and stop commands.
Strengths
- Supports background execution on both Android and iOS.
- Allows configuration of distance filters and time intervals.
- Supports custom Android notification settings for foreground services.
Weaknesses
- Requires manual platform configuration and permission declarations.
- Known issue where starting the service multiple times causes duplicate callbacks unless explicitly stopped.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Requires adding location permissions and background modes to iOS Info.plist and Android Manifest.xml.
BackgroundLocation.setAndroidNotification(title: "Title", message: "Message", icon: "@mipmap/ic_launcher");
BackgroundLocation.startLocationService(distanceFilter: 10);
BackgroundLocation.getLocationUpdates((location) {
print(location);
});Alternatives
Packages that do the same job and could replace background_location.
- geolocator
More actively maintained cross-platform location plugin with robust permission handling and extensive configuration options.
97Compare