MaikuB / flutter_local_notifications

A Flutter plugin for displaying local notifications on Android, iOS, macOS and Linux
2.47k stars 1.4k forks source link

Foreground notification click event #2272

Closed praveengitsit-pro closed 6 months ago

praveengitsit-pro commented 8 months ago

Not sure this is a bug but I looked through the documentations and could not find anything for this feature.

Describe the bug I cannot know when a user clicked on a notification when app is in foreground

To Reproduce

  1. App is in foreground
  2. App receives notification
  3. User clicks on notification
  4. Nothing happens

Expected behavior I want something like the FirebaseMessaging's onMessageOpenedApp method that exposes when a user has clicked on a notification when app is in background.

MaikuB commented 6 months ago

This is explained in the readme at https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications#initialisation and the repo has an example app and this is mentioned in the issue template when trying to submit a report as well