Flutter_local_notifications: Notifications never appear when app is terminated.

Created on 12 May 2020  路  8Comments  路  Source: MaikuB/flutter_local_notifications

Dear @MaikuB , do you confirm that, by design, the local notifications ARE triggered while the app is terminated.

if not, what are the steps to put in place to ensure that local notifications are triggered when the app is CLOSED or TERMINATED.

thank you for you help,
Abdelkrim

Most helpful comment

I can quickly look at code but I cannot spend the amount of time that you're asking for. Otherwise, I'd have everyone that has an issue trying getting their app to work. This isn't a sustainable approach given this is done out of my own spare time and it's an open-source project that is provided freely.

All 8 comments

Yes they work so long as you are using methods like schedule, periodicallyShow, showDailyAtTime and showWeeklyAtDayAndTime. In other words, it will work fine as long as you are scheduling a notification. I say that because there was another member of the community who thought using something like Future.delayed(...) to show a notification would work but Flutter/Dart will won't run any code passed in the callback there when the app is killed.

Note that there's also setup required that is documented in the readme that you should be following for those to work, especially on Android. Some Android devices from companies like Xiaomi have restrictions that prevent code from executing in the background

Also, a reminder that there's an example app in the repository. If you download or clone the repository you can explore the functionality

@MaikuB thank you.

I have followed the tutorial carefully and I have read the issues before notifying you; nevertheless the notification isn't triggered when the app is closed or terminated.

would you invest 20 minutes looking at my code?

I plan to make it public after it works

tell me if I can add you as reader of the code.

thank you

I can quickly look at code but I cannot spend the amount of time that you're asking for. Otherwise, I'd have everyone that has an issue trying getting their app to work. This isn't a sustainable approach given this is done out of my own spare time and it's an open-source project that is provided freely.

The other thing I forgot to add is if you're after detailed help with your app, the places to try to do are listed at https://flutter.dev/community (e.g. Stack Overflow)

thank you, I didn't know

Took a quick look and was able to change the code and have a scheduled notification appear 60 seconds later even though the app was closed. You'll need to check to see what you're missing but if you've been doing a release build, I can see you have missed steps in doing the release build configuration. Going to close this

@MaikuB, as a conclusion I did forget 2 tasks:

  1. to copy/paste the proguard-rules.pro
  2. to create the keep.xml file

Kind regards, your comment were sufficient for me to make the notifications work when the app is terminated!!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rafaelsetragni picture rafaelsetragni  路  5Comments

hsalazarl picture hsalazarl  路  6Comments

CedYF picture CedYF  路  6Comments

yanivshaked picture yanivshaked  路  5Comments

nonComBen picture nonComBen  路  4Comments