Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Scheduled flutter_local_notifications never appear when the app is closed

ErrorNotification shows while the app is open, but not when it is closed or the phone restarted

Short answer

Local notifications are scheduled with the system, so they should fire while the app is closed. When they do not, the usual causes are the Android 13 notification permission, a missing exact-alarm permission, no timezone setup for zonedSchedule, missing manifest receivers after reboot, or a phone vendor that kills background work.

  • Applies to flutter_local_notifications current, Flutter 3.x stable, Android 13 and newer, iOS 15+
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Schedule a notification a minute ahead, close the app, and look at the Flutter or logcat output when you do so. Then work through the causes in order.

    adb logcat -s flutter
  2. 2Match what you see, then jump to its fix

    1. 1Nothing shows at all on Android 13 or newer, or on iOSThe notification permission was never requestedFix
    2. 2Scheduled notifications never fire, the plugin logs an error about exact alarmsExact alarm permission is missing or was revokedFix
    3. 3The call to zonedSchedule fails or fires at the wrong timeTimezone data was not initialised for zonedScheduleFix
    4. 4They fire until the phone restarts or the app is updatedScheduled notifications vanish after a reboot or updateFix
    5. 5Everything is configured, yet it fails on phones from some makers onlyThe phone maker blocks background workFix

What does the error look like?

  • Notification shows while the app is open, but not when it is closed or the phone restarted
  • zonedSchedule does nothing, with no error shown

Cause 1 of 5

The notification permission was never requested

1Check

The package declares POST_NOTIFICATIONS, and on Android 13 and above you must request it at runtime. iOS asks through its own permission request.

grep -rn "requestNotificationsPermission\|requestPermissions" lib/

2Fix

Call the request once, from a screen the user sees.

await flutterLocalNotificationsPlugin
    .resolvePlatformSpecificImplementation<
        AndroidFlutterLocalNotificationsPlugin>()
    ?.requestNotificationsPermission();

3Verify

A notification fired immediately with show appears.

# call flutterLocalNotificationsPlugin.show(...) from a button

Confirmed by pub.dev

Did this fix it?

Cause 2 of 5

Exact alarm permission is missing or was revoked

1Check

Exact scheduling needs SCHEDULE_EXACT_ALARM (requested from the user) or USE_EXACT_ALARM (no prompt, API 33+, store review applies). If permission is revoked, the plugin logs an error and a repeating notification is not scheduled.

grep -n "EXACT_ALARM" android/app/src/main/AndroidManifest.xml

2Fix

Add the permission, ask for it, or switch to an inexact schedule mode.

<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
await androidImplementation?.requestExactAlarmsPermission();

3Verify

A notification scheduled a minute ahead fires with the app closed.

adb logcat -s flutter

Confirmed by pub.dev

Did this fix it?

Cause 3 of 5

Timezone data was not initialised for zonedSchedule

1Check

zonedSchedule takes a TZDateTime. The timezone package must be a dependency, and tz.initializeTimeZones() must run first. The package cannot detect the device zone by itself.

grep -rn "initializeTimeZones\|setLocalLocation" lib/

2Fix

Initialise the timezone data at startup and set the local location.

import 'package:timezone/data/latest_all.dart' as tz;
tz.initializeTimeZones();

3Verify

The scheduled time matches the device clock.

flutter run

Confirmed by pub.dev

Did this fix it?

Cause 4 of 5

Scheduled notifications vanish after a reboot or update

1Check

The plugin needs RECEIVE_BOOT_COMPLETED plus its ScheduledNotificationReceiver and ScheduledNotificationBootReceiver entries in the manifest.

grep -n "ScheduledNotification\|BOOT_COMPLETED" android/app/src/main/AndroidManifest.xml

2Fix

Add the permission and both receivers exactly as the package readme lists them.

# copy the receiver entries from the flutter_local_notifications readme into <application>

3Verify

Restart the phone and see the notification still fire.

adb reboot

Confirmed by pub.dev

Did this fix it?

Cause 5 of 5

The phone maker blocks background work

1Check

The readme names Xiaomi and Huawei as makers that stop apps from running in the background, and says the plugin cannot fix it. It also reports that Samsung limits scheduled alarms to 500.

# compare on a second phone from another maker

2Fix

Ask users to change the device's battery and background settings. dontkillmyapp.com lists the steps by device.

# follow the per-device steps listed on dontkillmyapp.com

3Verify

Notifications fire with the app closed on that phone.

adb logcat -s flutter

Confirmed by pub.dev

Did this fix it?

How do I stop it coming back?

  • Request notification permission at a clear point in the flow, not at install.
  • Test scheduled alerts on a closed app, a rebooted phone and a second brand of phone.
  • Keep the manifest entries from the package readme when upgrading the package.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.