{"id":32406889,"url":"https://github.com/rodsevich/android_alarm_manager_plus","last_synced_at":"2026-07-17T10:33:00.232Z","repository":{"id":147132855,"uuid":"292863033","full_name":"Rodsevich/android_alarm_manager_plus","owner":"Rodsevich","description":"Flutter plugin for accessing the Android AlarmManager service, and running Dart code in the background when alarms fire.","archived":false,"fork":false,"pushed_at":"2020-09-04T14:05:30.000Z","size":292,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-25T12:57:53.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/android_alarm_manager_plus","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rodsevich.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-09-04T14:04:40.000Z","updated_at":"2020-10-12T17:48:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"bec60a17-a382-4ee6-80a6-ea53adc7db04","html_url":"https://github.com/Rodsevich/android_alarm_manager_plus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rodsevich/android_alarm_manager_plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodsevich%2Fandroid_alarm_manager_plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodsevich%2Fandroid_alarm_manager_plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodsevich%2Fandroid_alarm_manager_plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodsevich%2Fandroid_alarm_manager_plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rodsevich","download_url":"https://codeload.github.com/Rodsevich/android_alarm_manager_plus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodsevich%2Fandroid_alarm_manager_plus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35579286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-17T02:00:06.162Z","response_time":116,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-25T12:57:21.267Z","updated_at":"2026-07-17T10:33:00.213Z","avatar_url":"https://github.com/Rodsevich.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Flutter Community: android_alarm_manager_plus](https://fluttercommunity.dev/_github/header/android_alarm_manager_plus)](https://github.com/fluttercommunity/community)\n\n# android_alarm_manager_plus\n\n[![pub package](https://img.shields.io/pub/v/android_alarm_manager_plus.svg)](https://pub.dev/packages/android_alarm_manager_plus)\n[![Flutter Unit Tests](https://github.com/fluttercommunity/android_alarm_manager_plus/workflows/Flutter%20Unit%20Tests/badge.svg)](https://github.com/fluttercommunity/android_alarm_manager_plus/actions)\n\nA Flutter plugin for accessing the Android AlarmManager service, and running\nDart code in the background when alarms fire.\n\n## Getting Started\n\nAfter importing this plugin to your project as usual, add the following to your\n`AndroidManifest.xml` within the `\u003cmanifest\u003e\u003c/manifest\u003e` tags:\n\n```xml\n\u003cuses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/\u003e\n\u003cuses-permission android:name=\"android.permission.WAKE_LOCK\"/\u003e\n```\n\nNext, within the `\u003capplication\u003e\u003c/application\u003e` tags, add:\n\n```xml\n\u003cservice\n    android:name=\"io.flutter.plugins.androidalarmmanager.AlarmService\"\n    android:permission=\"android.permission.BIND_JOB_SERVICE\"\n    android:exported=\"false\"/\u003e\n\u003creceiver\n    android:name=\"io.flutter.plugins.androidalarmmanager.AlarmBroadcastReceiver\"\n    android:exported=\"false\"/\u003e\n\u003creceiver\n    android:name=\"io.flutter.plugins.androidalarmmanager.RebootBroadcastReceiver\"\n    android:enabled=\"false\"\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"android.intent.action.BOOT_COMPLETED\"\u003e\u003c/action\u003e\n    \u003c/intent-filter\u003e\n\u003c/receiver\u003e\n\n```\n\nIf you want the app to wakeup you also need to add this permissions to the activity tag:\n\n```xml\n\u003cactivity\n ...\nandroid:turnScreenOn=\"true\" android:showWhenLocked=\"true\"\u003e\n```\n\nThen in Dart code add:\n\n```dart\nimport 'package:android_alarm_manager/android_alarm_manager.dart';\n\nvoid printHello() {\n  final DateTime now = DateTime.now();\n  final int isolateId = Isolate.current.hashCode;\n  print(\"[$now] Hello, world! isolate=${isolateId} function='$printHello'\");\n}\n\nmain() async {\n  final int helloAlarmID = 0;\n  await AndroidAlarmManager.initialize();\n  runApp(...);\n  await AndroidAlarmManager.periodic(const Duration(minutes: 1), helloAlarmID, printHello);\n}\n```\n\n`printHello` will then run (roughly) every minute, even if the main app ends. However, `printHello`\nwill not run in the same isolate as the main application. Unlike threads, isolates do not share\nmemory and communication between isolates must be done via message passing (see more documentation on\nisolates [here](https://api.dart.dev/stable/2.0.0/dart-isolate/dart-isolate-library.html)).\n\n## Using other plugins in alarm callbacks\n\nIf alarm callbacks will need access to other Flutter plugins, including the\nalarm manager plugin itself, it may be necessary to inform the background service how\nto initialize plugins depending on which Flutter Android embedding the application is\nusing.\n\n### Flutter Android Embedding V2 (Flutter Version \u003e= 1.12)\n\nFor the Flutter Android Embedding V2, plugins are registered with the background\nisolate via reflection so `AlarmService.setPluginRegistrant` does not need to be\ncalled.\n\n**NOTE: this plugin is not completely compatible with the V2 embedding on\nFlutter versions \u003c 1.12 as the background isolate will not automatically\nregister plugins. This can be resolved by running `flutter upgrade` to upgrade\nto the latest Flutter version.**\n\n### Flutter Android Embedding V1 (DEPRECATED)\n\nFor the Flutter Android Embedding V1, the background service must be provided a\ncallback to register plugins with the background isolate. This is done by giving\nthe `AlarmService` a callback to call the application's `onCreate` method. See the example's\n[Application overrides](https://github.com/fluttercommunity/android_alarm_manager_plus/example/android/app/src/main/java/io/flutter/plugins/androidalarmmanagerexample/Application.java).\n\nIn particular, its `Application` class is as follows:\n\n```java\npublic class Application extends FlutterApplication implements PluginRegistrantCallback {\n  @Override\n  public void onCreate() {\n    super.onCreate();\n    AlarmService.setPluginRegistrant(this);\n  }\n\n  @Override\n  public void registerWith(PluginRegistry registry) {\n    GeneratedPluginRegistrant.registerWith(registry);\n  }\n}\n```\n\nWhich must be reflected in the application's `AndroidManifest.xml`. E.g.:\n\n```xml\n    \u003capplication\n        android:name=\".Application\"\n        ...\n```\n\n**Note:** Not calling `AlarmService.setPluginRegistrant` will result in an exception being\nthrown when an alarm eventually fires.\n\n## Plugin Development\n\n### Running Flutter unit tests\n\nRun normally with `flutter test` from the root of the project.\n\n### Running Espresso tests\n\nThe Espresso test runs the same sample code provided in `example/lib/main.dart`\nbut is run using the Flutter Espresso plugin.\n\nModifying the `main.dart` will cause this test to fail.\n\nThis test will call into the `example/lib/main_espresso.dart` file which\nwill enable Flutter Driver and then calls into the `main.dart`.\n\nSee https://pub.dev/packages/espresso for more info on why.\n\nTo run the test, run from the `example/android` folder:\n\n```\n./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../lib/main_espresso.dart\n```\n\n### Running End-to-end Flutter Driver tests\n\nWork In Progress.\n\nTo run the Flutter Driver tests, cd into `example` and run:\n\n```\nflutter driver test_driver/android_alarm_manager_e2e.dart\n```\n\n## Need more help?\n\nFor help getting started with Flutter, view our online\n[documentation](http://flutter.io/).\n\nFor help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodsevich%2Fandroid_alarm_manager_plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodsevich%2Fandroid_alarm_manager_plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodsevich%2Fandroid_alarm_manager_plus/lists"}