Flutter native notifications not firing after midnight on each iOS and Android till app is opened

0
1
Flutter native notifications not firing after midnight on each iOS and Android till app is opened


Вот переформулированный вопрос без упоминания лекарств:


Title: Flutter native notifications not firing after midnight on each iOS and Android till app is opened

Physique:

I am experiencing a problem the place scheduled native notifications cease working after midnight on each iOS and Android, however provided that the app hasn’t been opened because the notifications have been scheduled.

State of affairs:

  1. Consumer interacts with the app in the course of the day and completes a number of duties
  2. Every accomplished job schedules a notification for a similar time subsequent day
  3. Consumer closes the app within the night (e.g., 21:00) and would not open it once more
  4. Subsequent morning, NO notifications arrive at scheduled occasions
  5. BUT if consumer opens the app even briefly after midnight, all subsequent notifications for that day work completely

Present implementation:

  • Utilizing flutter_local_notifications package deal
  • Scheduling with flutterLocalNotificationsPlugin.zonedSchedule()
  • Utilizing AndroidScheduleMode.alarmClock for Android
  • Notifications are scheduled accurately (verified with debug logs)

Testing outcomes:

  • Works completely in emulator even when altering system time
  • Works on bodily gadget when manually altering time
  • Fails solely in real-world situation when gadget sleeps in a single day
  • Similar conduct on each iOS and Android

Code snippet:

await flutterLocalNotificationsPlugin.zonedSchedule(
  notificationId,
  title,
  physique,
  tzDateTime,
  notificationDetails,
  payload: payload,
  uiLocalNotificationDateInterpretation:
      UILocalNotificationDateInterpretation.absoluteTime,
  androidScheduleMode: AndroidScheduleMode.alarmClock,
);

It looks as if the OS is killing scheduled notifications in the course of the evening. Has anybody skilled this? What is the correct manner to make sure notifications survive in a single day with out opening the app?

LEAVE A REPLY

Please enter your comment!
Please enter your name here