Ad

How To Find Out If A Notification Is Scheduled?

- 1 answer

Using flutter_local_notifications I create a scheduled notification like this:

final tz.TZDateTime nextInstance = calcNextInstanceOfDayOfWeekAndTime(dayOfWeek, hour, minute);
await _flutterLocalNotificationsPlugin.zonedSchedule(
  notificationId,
  title,
  body,
  nextInstance,
  matchDateTimeComponents: DateTimeComponents.dayOfWeekAndTime,
  uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime,
  // ... payload and other details
);

Some days later I want to check if notificationId is scheduled or not.

Or more generally speaking: I wonder how to get a list of the currently scheduled notifications.

If this is not possible with flutter_local_notifications is that possible with awesome_notifications? I could not find any information in the readmes of the packages regarding this.

Ad

Answer

In awesome_notifications there is a method to list all scheduled notifications:

AwesomeNotifications().listScheduledNotifications()
Ad
source: stackoverflow.com
Ad