HomeiOS DevelopmentFlutter native notifications not firing after midnight on each iOS and Android...

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 for the reason that notifications had been scheduled.

State of affairs:

  1. Person interacts with the app through the day and completes a number of duties
  2. Every accomplished activity schedules a notification for a similar time subsequent day
  3. Person 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 instances
  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 bundle
  • 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 machine when manually altering time
  • Fails solely in real-world state of affairs when machine sleeps in a single day
  • Identical habits 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 like the OS is killing scheduled notifications through the night time. Has anybody skilled this? What is the correct method to make sure notifications survive in a single day with out opening the app?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments