android_alarm_manager_plus
5.1.2, released 7 weeks ago by fluttercommunity.dev
Access Android AlarmManager service and run Dart code in the background.
What it does
Allows Flutter applications to access the Android AlarmManager service. Enables running custom Dart code in background background isolates when alarms fire, even if the main app has ended.
AI-written summary of version 5.1.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to trigger recurring tasks or one-off alarms on Android at precise times.
- You need background tasks to execute when the app is closed or not in the foreground.
Skip it when
- You need cross-platform background task handling that includes iOS.
- Your app targets Android 14+ and you cannot handle SCHEDULE_EXACT_ALARM permissions via additional plugins.
Strengths
- Integrates directly with native Android AlarmManager service.
- Supports periodic and one-shot background alarms with custom callbacks.
Weaknesses
- Android only (no iOS or web support documented).
- Alarms are cleared if the device is rebooted unless properly configured, and will not fire if the app is force-stopped.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Requires adding permissions and receiver/service components to AndroidManifest.xml, plus handling SCHEDULE_EXACT_ALARM permissions for Android 14+ via an additional plugin like permission_handler.
import 'package:android_alarm_manager_plus/android_alarm_manager_plus.dart';
@pragma('vm:entry-point')
static void printHello() {
print("Hello, world!");
}
main() async {
WidgetsFlutterBinding.ensureInitialized();
await AndroidAlarmManager.initialize();
runApp(...);
await AndroidAlarmManager.periodic(const Duration(minutes: 1), 0, printHello);
}Alternatives
Packages that do the same job and could replace android_alarm_manager_plus.
- sensors_plus
Flutter plugin to access accelerometer, gyroscope, magnetometer, and barometer sensors.
96Compare - flutter_foreground_task
Implement and manage foreground services on Android and iOS platforms.
89Compare - screen_state
Tracks screen state events on Android and iOS.
81Compare - platform_detect
Detects browser and OS types and versions in Dart web apps.
71Compare
Works with
Packages commonly used together with android_alarm_manager_plus: ones it builds on, ones built on it, and its own family.