flutter_local_notifications icon indicating copy to clipboard operation
flutter_local_notifications copied to clipboard

Inconsistently scheduling daily push notifications on my flutter iOS app (version of iOS: 18.1)

Open benj12 opened this issue 1 year ago • 1 comments

Describe the bug

I'm trying to schedule daily local push notifications on my flutter iOS app. When I call my daily schedule function, it doesn't consistently schedule notifications daily and also at the same time every day.

To Reproduce

  1. Clone the repository
  2. Checkout branch 99f0601
  3. Run the app by running flutter run (make sure you have an iOS Xcode simulator for iPhone with iOS 18.1 installed.
  4. Once app is loaded, scroll down to the very bottom and switch the toggle switch on that says "Schedule notifications for 14 days".
  5. I'm calling dNotifs in services/scheduleNotifications.dart in my home.dart file. The dNotifs is at the very bottom of my code in my home.dart that will schedule a notification daily.

Expected behavior

The expected behavior is that it would schedule a daily notification consistently. What I would also like to happen is to schedule the notification at whatever time the user would like and to schedule it daily for 14 days.

Sample code to reproduce the problem go to https://www.github.com/benj12/testapp to fork this repository. For the dNotifs function, go to https://github.com/benj12/testapp/blob/99f060185d1f5c54a171114bc031d616a8f39c76/lib/services/schedule_notifications.dart#L65C3-L74C4

benj12 avatar Oct 31 '24 00:10 benj12

Can be more specific about the steps to reproduce the issue? One thing I've noticed is you use the same notification ID throughout your code. This means everytime a notification is scheduled, the time will change is the notification ID is meant to be unique. This could well explain what you're seeing as you're updating the previously scheduled notification

MaikuB avatar Nov 29 '24 03:11 MaikuB