MaikuB / flutter_local_notifications

A Flutter plugin for displaying local notifications on Android, iOS, macOS and Linux
2.47k stars 1.4k forks source link

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

Open benj12 opened 2 weeks ago

benj12 commented 2 weeks ago

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