top of page

[Flutter/dart] Do not reset notifications local_notification when the app is restarted


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?)

Recent Posts

See All

[Flutter/Dart] Format string with TextField

What want to do I want to create an input form using TextField. For example, if the input content is a monetary amount, I would like to display it in 3-digit delimiters with a ¥ prefix. Rather than ha

Comments


Let's do our best with our partner:​ ChatReminder

iphone6.5p2.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Let's do our best with our partner:​ ChatReminder

納品:iPhone6.5①.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Theme diary: Decide the theme and record for each genre

It is a diary application that allows you to post and record with themes and sub-themes for each genre.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png
bottom of page