background_location_plus
A Flutter plugin for reliable foreground and background location tracking on iOS and Android.
Designed for apps that require precise, continuous geolocation such as delivery, workforce tracking, attendance, trip logging, field services, and more.
โจ Features
- High-accuracy location updates
- Background location tracking (iOS & Android)
- Low battery consumption
- Stream-based API
- Fully customizable
- Production-ready
- Works with minimized, locked, or inactive apps
- Safe iOS background mode setup included
๐ฆ Installation
Add to your pubspec.yaml:
dependencies:
background_location_plus: ^0.0.1
Run
flutter pub get
๐ง iOS Setup (Required)
- Add permissions to Info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to track your trips.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Your location is used even in background.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Your location is used even when the app is closed.</string>
- Enable Background Modes
Open Xcode โ Runner โ Signing & Capabilities โ + Capability:
Location updates
Background processing
๐ง Android Setup (Required)
Add these permissions inside android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<service
android:name="com.your_package.background_location_plus.LocationService"
android:foregroundServiceType="location" />
๐งช Example App
Check the /example folder for full working code.
๐ Roadmap
Geofence support
Activity recognition
Custom update intervals
Android foreground notification customization
โค๏ธ Contributing
Pull requests are welcome.
Please open an issue if you find a bug or require a feature.
๐ License
MIT License โ see LICENSE file.