# Advanced Background Locator
**`advanced_background_locator`** is a Flutter plugin for advanced background location tracking. This package provides functionalities to track user location even when the app is running in the background.
## Features
- Track user location in the background.
- Customizable settings for notifications and location updates.
- Support for different location clients.
## Installation
To use this package, add `advanced_background_locator` as a dependency in your `pubspec.yaml` file:
```yaml
dependencies:
advanced_background_locator: ^0.0.3
Run flutter pub get
to install the package.
Usage
Setup
-
Configure AndroidManifest.xml
Add the following permissions to your
AndroidManifest.xml
file:<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
Ensure you add the required service and receiver declarations as well.
-
Initialize the Plugin
Initialize the plugin in your Flutter app. You can do this in your main entry file (
main.dart
orApplication.kt
).import 'package:advanced_background_locator/advanced_background_locator.dart'; void main() { AdvancedBackgroundLocator.initialize(); runApp(MyApp()); }
Configuration
Configure the plugin using the PreferencesManager
class:
import 'package:advanced_background_locator/advanced_background_locator.dart';
void configureSettings() {
final settings = {
'channelName': 'Your Channel Name',
'channelTitle': 'Your Channel Title',
'notificationMessage': 'Your Notification Message',
// other settings
};
PreferencesManager.saveSettings(context, settings);
}
Start Tracking
Start tracking the location using the following method:
import 'package:advanced_background_locator/advanced_background_locator.dart';
void startLocationTracking() {
AdvancedBackgroundLocator.startTracking();
}
Stop Tracking
Stop location tracking when it's no longer needed:
import 'package:advanced_background_locator/advanced_background_locator.dart';
void stopLocationTracking() {
AdvancedBackgroundLocator.stopTracking();
}
Example
An example of using this package can be found in the example
directory of this repository.
Contributing
Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request.
License
This package is licensed under the MIT License. See the LICENSE file for more details.
Contact
For any inquiries or issues, please contact the maintainer:
- Name: Abdurrahman Karaoğlu
- Email: abdurrahmank118@gmail.com
Feel free to modify this README according to your specific needs or additional features your package may have. If you have any other requirements or questions, just let me know!