Menu

1 / 2

Flutter exact alarm permission on Android 14: stop the jump to Settings

DEV Community: flutter·Mohamed Gado·9 days ago
#7zBZ68mZ
#devtoflutter#devto#dev#alarm#permission
Long article (963 words) — no AI summary yet.
Reading 0:00
15s threshold

Hadeed , my offline gym log, has a rest timer. You finish a set, tap "Set done", put the phone in your pocket, and it rings when rest is over. On my Android 14 phone, the first "Set done" of every session did something else: it opened Android's Alarms & reminders settings page and threw me out of the app mid-set. The call behind it, requestExactAlarmsPermission() from flutter_local_notifications, had been there since the first commit. Fixing it uncovered a second bug underneath. Without that permission, an alarmClock schedule never rang at all.

Why requestExactAlarmsPermission opens Settings

Exact alarms are a special permission on Android 12 and later. There's no runtime dialog for SCHEDULE_EXACT_ALARM . The only way to "request" it is to send the user to a system settings page where they flip a switch for your app. On Android 14, apps that aren't alarm clocks or calendars start with this permission denied.

flutter_local_notifications exposes this as requestExactAlarmsPermission() .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.