geofence_foreground_service
1.5.0, released 6 days ago by baselhadrous.com
A Flutter plugin that handles geofencing using a foreground service on Android and Core Location on iOS.
What it does
Enables monitoring of circular areas and polygon zones in the foreground and background. It triggers callbacks when devices enter, exit, or dwell in specified zones, handling re-registrations after reboots.
AI-written summary of version 1.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need background geofencing capabilities on both Android and iOS.
- Your app requires Android foreground service notifications for location tracking.
- You need to monitor circular or polygon-based geographical regions.
Skip it when
- You only need basic maps rendering without geofencing logic.
- You cannot accept the requirement for Android background location permissions.
Strengths
- Supports both circular and polygon-based zones.
- Survives Android device reboots and app updates.
- Provides background and foreground geofence monitoring.
Weaknesses
- Requires complex native permission and service setup on Android and iOS.
- Platform differences mean some advanced configurations are ignored on iOS.
Setup
- Kind
- Plugin (native code)
- Effort
- High
- Code generation
- No
- Direct dependencies
- 2
Requires Android Multidex, SDK 29+, compileSdk 36+, runtime location and notification permissions, and iOS Info.plist location usage descriptions along with Location updates and Background fetch capabilities.
Future<void> initPlatformState() async {
bool hasServiceStarted = await GeofenceForegroundService().startGeofencingService(
contentTitle: 'Test app is running',
contentText: 'Running in background',
notificationChannelId: 'channel_id',
serviceId: 525600,
callbackDispatcher: callbackDispatcher,
);
}Alternatives
Packages that do the same job and could replace geofence_foreground_service.
- geolocator
If you need general geolocation updates rather than specialized geofence foreground services.
97Compare
Works with
Packages commonly used together with geofence_foreground_service: ones it builds on, ones built on it, and its own family.