[Flutter/dart] Do not reset notifications local_notification when the app is restarted
- M.R

- Aug 15, 2021
- 1 min read
Overview
You can easily create notifications using a library called flutter_local_notificaton.
However, if you turn off the app once after creating the notification and then launch it again, the notification will be reset and you will not receive the notification even at the specified time.
Solution
In fact, there doesn't seem to be a fundamental solution yet. So, as a temporary measure, I am recreating the notification every time the application is launched (such as main or initState () of some state).
For this reason, specify the notification date and time as absolute (month, day, and hour) rather than relative (hours from now, etc.).
Lastly
If you just turn off the app, you will be notified properly. It will be reset when the app is launched.
There was an article saying that you should write xxx in AndroidManifest, but it didn't work for me (environmental problem?)






Comments