Feature request about always calling onDidReceiveLocalNotification callback when the app is on foreground, on every platform (not only iOS < 10).
This issue is only about enabling the callback on foreground, not on background or terminated.
Local notification is always shown on time.
| |Foreground|Background|
|-|-|-|
|show()|Show notification|Show notification|
Local notification is shown when the application is on the background or terminated. When the application is on foreground, the callback in the application is called.
| |Foreground|Background|
|-|-|-|
|show()|call onDidReceiveLocalNotification|Show notification|
The UI can reflect the scheduled change immediately, when a scheduled notification is fired.
For example, a simple app that asks a question every day at 8 am. The app notifies the user about a question, or if the app is open, the question can be asked immediately without a notification.
The purpose of the plugin is to provide access to the native notification APIs to show notifications. It isn't to cover every possible use case and what you're after is application-specific. Furthermore, from what you described it would introduce a breaking change to everyone else and defeat the purpose of this plugin. As such, if you need this kind of behaviour for your application then it is up to you to implement this. This project is open-source so you are free to fork and modify for your own purposes.
Closing as it won't be worked on
Thank you for the quick response! 馃挴
The same feature could have been implemented in a non-breaking way (not using the existingonDidReceiveLocalNotification).
The feature would result into similar behaviour with firebase notifications. https://pub.dev/packages/firebase_messaging#receiving-messages
Anyway, I do understand the point of not adding every feature request to the package. Thanks!
The same feature could have been implemented in a non-breaking way (not using the existingonDidReceiveLocalNotification).
I was referring more to the fact that your description of the new behaviour would mean a callback is triggered instead of displaying a notification.
The feature would result into similar behaviour with firebase notifications.
The behaviour may be similar but Firebase messaging isn't quite a valid comparison as push/remote notifications in general (i.e. irrespective of it they were generated from Firebase or not) behave differently than local notifications.
Anyway, I do understand the point of not adding every feature request to the package. Thanks!
Thanks for your understanding and good luck on implementing the features you need
@jaripekkala, have you implemented this feature for yourself? If so, maybe you could share the code? I think such feature will be useful for many of us =)
Hi @Diaglyonok, we ended up writing a new local notifications package entirely. It's not public, at least at the moment.
I recommend contributing to this open source package instead 馃檹