flutter_local_notifications icon indicating copy to clipboard operation
flutter_local_notifications copied to clipboard

How to access the event of the notification execution

Open touagueni opened this issue 2 years ago • 4 comments

I am using Flutter Local Notifications Plugin to schedule notifications on demand in my app.

1.The notifications work fine and arrive as scheduled. 2.The onSelectNotification executes fine when the particular notification is selected. ... await flutterLocalNotificationsPlugin.initialize( initializationSettings, onSelectNotification: selectNotification ); ...

The question: how to access the event of the notification at the execution time?, in other words when a local scheduled notification gets delivered.

Thanks

touagueni avatar Feb 01 '22 06:02 touagueni

There's no such event for it within the plugin. If it's technically possible to implement then this is something you'll need to look it and could submit a PR back to the repo

MaikuB avatar Feb 03 '22 10:02 MaikuB

Hi MaikuB, Many Thanks for your reply.

Sorry I have no idea on how to implement it, at the same time we need it badly for our app. We have actually used server based notification first and we had access the event in question (i.e. the reception of a notification) then because our app will be used in parts of the world where the internet bandwidth was not particularly good we have decided to go for local notifications for the reminders. Local notifications does the job perfectly for what we are trying to do, except that we don't know how to show the number of notifications on the notifications badge inside the app. Any help would appreciated.

Thanks and Kind Regards

Tewfik

touagueni avatar Feb 07 '22 11:02 touagueni

As you pivoted your original solution to use native APIs, then I would you should really be trying to understand said APIs and be prepared to develop a solution using them as open-source libraries may not cover all scenarios. I'm not able to help further myself as this is something I maintain in my own spare time and I have my own priorities too. So as mentioned before, you'll likely need to look into further yourself or seek others to help. It may be that this requires the use of background isolates that were used for notification actions and this was something that contributed by the community. As this is open-source, you're free to fork the repo as a starting point and make the appropriate modifications

MaikuB avatar Feb 10 '22 09:02 MaikuB

This will help https://www.youtube.com/watch?v=aQTvI8L-mZs

myselfuser1 avatar Mar 17 '23 12:03 myselfuser1