2

I am working on a flutter app, In which using flutter_local_notifications for the local notification. Weekly notification is working fine for selecting the only day on weekdays. Now I want to pick multiple days on weekdays like (Monday, Thursday, and Saturday). I couldn't find any solution to implement. Sharing my sample code.

showNotificationWeekly() {
     var time = Time(10, 0, 0);
     var androidPlatformChannelSpecifics = AndroidNotificationDetails(
     'id',
     'name',
     'description',
     );
     var iOSPlatformChannelSpecifics = IOSNotificationDetails();
     var platformChannelSpecifics = NotificationDetails(
     androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
     await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(
     0,
     'show weekly title',
     'Weekly notification',
     Day.Monday,
     time,
     platformChannelSpecifics,
     );
}

Please let me know, If any solution for this so that I can set one notification for multiple days

sagarSaw
  • 89
  • 11
  • Did you eventually find an answer to your question? Having the same problem right now – Sebb Feb 28 '23 at 17:13

2 Answers2

1

I think you will need to schedule multiple Notifications, one for each day :/

Taldorr
  • 175
  • 1
  • 4
  • 11
  • Thanks for the response but I cannot store multiple notification Id for a single event. Is there any way to do which I have mentioned? – sagarSaw Jul 02 '20 at 13:05
  • 1
    There is no way, using the api of this plugin. You could either store multiple IDs or schedule it daily and check if the current date is Monday, Thursday or Saturday – Taldorr Jul 02 '20 at 13:09
  • take the week days from user they want to get notified. call "flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime" for each day in a function when user press submit button. you can give different IDs. no issue. – Touhid Sunny Jul 24 '20 at 07:16
1

Thanks, It require unique notification ID for each notification.

sagarSaw
  • 89
  • 11