Closed Lzyct closed 8 months ago
Hello,
It looks like you're encountering the device-specific limit (500) for scheduled notifications, which is common on some Android devices. The Flutter Local Notifications plugin documentation mentions this limit, and reducing the number of notifications to below this threshold, as you did, is a common workaround.
To avoid hitting these limits, you might consider:
Here's a quick code snippet to limit the number of scheduled notifications:
int maxNotifications = 100; // Adjust based on your needs
for (int index = 0; index < maxNotifications; index++) {
flutterLocalNotificationsPlugin.zonedSchedule(
index + 1,
title,
message,
TZDateTime.now(local).add(Duration(seconds: 60 * (index + 1))),
notificationDetails,
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime,
androidScheduleMode: AndroidScheduleMode.alarmClock,
);
}
Adjust maxNotifications
based on testing or device-specific limits. Hope this helps!
Okay, thanks @nbergemann
Describe the bug I've created a
zonedSchedule
notification with about 500 notifications. The notification is created. But it doesn't work. But when I decrease the amount of notifications to 6-30 notifications, that's working well.To Reproduce
zonedSchedule
of about 500Expected behavior That notification should be work because there no error when creating the
zoneSchedule
notification.Sample code to reproduce the problem