Package selection guidance compiled from public package information, community data, and project usage.
A Firebase adapter for the flutter_background_geolocation plugin that automatically syncs recorded location data to Firestore. Designed to work seamlessly with the background geolocation service, it enables real-time tracking and persistent storage of device locations in a Firebase database. Ideal for applications requiring continuous location monitoring, such as fleet management, delivery tracking, or activity logging. The package handles data synchronization efficiently, ensuring reliability across Android and iOS platforms.
Use cases
Real-time fleet tracking
Delivery route monitoring
Activity and journey logging
Location-based analytics
User activity tracking
Key features
Automatic Firestore sync
Cross-platform support (Android/iOS)
Seamless integration with flutter_background_geolocation
Reliable offline-to-online data transfer
Configurable upload intervals
Suitable for
Fleet and logistics apps
Fitness and outdoor tracking apps
Field service management
Applications requiring persistent location history
Considerations
Requires Firebase Firestore setup
May incur cloud storage costs
Depends on underlying background_geolocation plugin
Network connectivity affects sync timing
Permissions required for background location access
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
background_geolocation_firebase
Firebase Proxy for Flutter Background Geolocation. The plugin will automatically post locations to your own Firestore database, overriding the flutter_background_geolocation plugin's SQLite / HTTP services.
If you prefer, you can instruct the plugin to update a single document in Firebase rather than creating a new document for eachlocation / geofence. In this case, you would presumably implement a Firebase Function to deal with updates upon this single document and store the location in some other collection as desired. If this is your use-case, you'll also need to ensure you configure your locationsCollection / geofencesCollection accordingly with an even number of "parts", taking the form /collection_name/document_id, eg:
BackgroundGeolocationFirebase.configure(BackgroundGeolocationFirebaseConfig(
locationsCollection: '/locations/latest'// <-- 2 "parts": even
));
// orBackgroundGeolocationFirebase.configure(BackgroundGeolocationFirebaseConfig(
locationsCollection: '/users/123/routes/456/the_location'// <-- 4 "parts": even
));
// Don't use an odd number of "parts"BackgroundGeolocationFirebase.configure(BackgroundGeolocationFirebaseConfig(
locationsCollection: '/users/123/latest_location'// <-- 3 "parts": odd!! No!
));
License
The MIT License (MIT)
Copyright (c) 2018 Chris Scott, Transistor Software
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.