Android Exact Alarm Permission Skill
Overview
This skill documents how to:
- •Remove the deprecated
USE_EXACT_ALARMpermission. - •Use
permission_handlerto check and requestSCHEDULE_EXACT_ALARM. - •Update
HybridRunnerwithcanScheduleExactAlarms()andopenExactAlarmSettings(). - •Add UI flow in the example app.
Steps
- •Manifest – Remove
<uses-permission android:name="android.permission.USE_EXACT_ALARM"/>from both package and example manifests. - •Dependency – Add
permission_handlertopubspec.yaml. - •HybridRunner API – Implement static methods:
dart
static Future<bool> canScheduleExactAlarms() async { final status = await Permission.scheduleExactAlarm.status; return status.isGranted; } static Future<void> openExactAlarmSettings() async { await Permission.scheduleExactAlarm.request(); } - •Example UI – Add a permission status card and a dialog that calls
openExactAlarmSettings(). - •README – Document the new permission flow with screenshots and a compatibility table.
- •Testing – Verify on Android 14+ devices that the permission dialog appears and tasks schedule correctly.
References
- •Android 14 exact alarm changes: https://developer.android.com/about/versions/14/changes/schedule-exact-alarms
- •permission_handler package docs.