NotificationActionTapped Only Returns ReturningData From Last-Added Notification
@thudugala is already working on this.
Since May 19, 2023.
Assessment
This issue has not been assessed yet.
Description
I'm using V. 10.1.3 in a .Net Maui application.I add two notifications all at once with each having a different kind of ReturningData,but no matter which notification I tap in the Notification center,just the ReturningData of the last-added notification is returned.I think it's a bug,which needs to be fixed.
The same issue as in: #312 ,but the problem still persists even though it's been closed!
Also take a look at the following Discussion:
I will try to be clear as possible.
I am testing the plugin and everything is really clear and simple to this point. But I have a problem with the NotificationActionTapped event.
In my testing app I created two NotificationRequest with different NotificationId, Title, description, etc. I show the two notifications. The two notifications are send and I can tapped them. Their is notification 1 who is show first and notification 2 who is show second.
When I tapped notification 1 or 2, its always the data of the last show notification that its received. I cannot acces the data of the first show notification.
Code exemple to help understand what I am trying to explain
I create the two notification
var notification1 = new NotificationRequest { BadgeNumber = 1, Title = "Title 1", Description = "Description 1", ReturningData = "Data 1", NotificationId = 1, Schedule = { NotifyTime = DateTime.Now.AddSeconds(5) }, }; var notification2 = new NotificationRequest { Android = { Priority = AndroidPriority.High, }, BadgeNumber = 1, Title = "Title 2", Description = "Description 2", ReturningData = "Data 2", NotificationId = 2, Schedule = { NotifyTime = DateTime.Now.AddSeconds(5) }, }; LocalNotificationCenter.Current.Show(notification1); LocalNotificationCenter.Current.Show(notification2);A little Display to show the received data after the tapped notification
LocalNotificationCenter.Current.NotificationActionTapped += Current_NotificationActionTapped; private void Current_NotificationActionTapped(Plugin.LocalNotification.EventArgs.NotificationActionEventArgs e) { LocalNotificationCenter.Current.GetDeliveredNotificationList(); App.Current.MainPage.DisplayAlert(e.Request.Title, e.Request.Description, "ok"); }The display is alway the data from the second notification
Is it by design or there is something I'm doing wrong?
Thank you!
Originally posted by @AlexForget in https://github.com/thudugala/Plugin.LocalNotification/discussions/359
- Dominant language
- C#
- Stars
- 474
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thudugala/Plugin.LocalNotification
-
Android Configuration Issue
Difficulty 4/5 3-5 days Newbie friendliness 45/100
thudugala/Plugin.LocalNotification#541 · 3 comments ·
-
Configuration Issue
thudugala/Plugin.LocalNotification#537 · 15 comments · 1 assignee ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
thudugala/Plugin.LocalNotification#532 · 4 comments · 1 reaction ·
-
Configuration Issue
Difficulty 4/5 3-5 days Newbie friendliness 25/100
thudugala/Plugin.LocalNotification#521 · 4 comments · 1 reaction ·
-
Android bug
thudugala/Plugin.LocalNotification#520 · 2 comments · 1 assignee ·
All issues in thudugala/Plugin.LocalNotification
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
