-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xamarin Forms - Android - Cancel and CancelAll not working. #380
Comments
Anyone else having this issue on the latest version? |
Yea I'm having this issue. |
I am also having this issue on .NET 7 MAUI - Android |
I am also having this issue with MAUI project running on Android, is there a chance that this issue is fixed soon? I cannot use this plugin since the end user cannot cancel a notification, code: var request = new NotificationRequest
-- cancel method |
I have the same issue too. Xamarin.Forms 5.0.0.2578 bool resultAlerts = Plugin.LocalNotification.LocalNotificationCenter.Current.Cancel(111); - true var listPending = await Plugin.LocalNotification.LocalNotificationCenter.Current.GetPendingNotificationList(); - |
Same issue! Please fix or help! |
Fix the issue by installing version 10.1.3. |
It's working in that version for you? |
Yes, it's working perfect (Android and ios), by installing version 10.1.3. |
It still doesn't cancel for me on 10.1.3 either! |
May I see your request settings? |
Xamarin.Forms 5.0.0.2578 Xamarin.AndroidX.Core 1.9.0.2 var notificationRepeat = new NotificationRequest
LocalNotificationCenter.Current.Cancel(notificationsid); Check that Cancel is not within a task or a transaction or in any backgruond process. |
How you know its canceled and not cleared, this is scheduled notification not repeating one, for me downgrading didn't do the job it clears the notification but it does not cancel it. |
Yeah. I've set my notification to be repeating every 10s just to set it up and I use Cancel() function with notification ID. It clears but it it doesn't stop the notification repeatness. |
So after more testing I realised the cancel was being called before the show, with how my threading was working. But now I fixed that, it is also seemingly working on 10.1.4. Whereas clearly lots of people are still having issues with that, like I first raised. |
I am calling Cancel() after button click so I have no clue and I am certain that my Cancel() function is being called after Send() function. |
That's the boat I was in, so I have no idea why mine seems to be working now! I haven't fully tested, I've just tested doing a loop to create 5 notifications 5 seconds apart. And then calling cancel on the first 2 ids, and it worked to only show the last 3 test notifications. But this previously hadn't been working. In my real code, I'm calling CancelAll before then recreating all notifications, when the user changes what time they want the notifications. This part I haven't managed to check yet. |
May I message you so we can have a chat about that? I really need to find a way to fix this issue. |
@minitockers Please try Version 10.1.5 cc @CamilaPedocchi @keke1210 @mbouarroudj FYI v10.1.5 has a breaking change Android permission must be specified at the application level now. |
Version 10.1.5 works. Thank you. |
I'm scheduling notifications like this:
When I try to cancel any scheduled notification, with either
LocalNotificationCenter.Current.Cancel(id);
orLocalNotificationCenter.Current.CancelAll();
the notifications are still received.I have to reschedule all notifications when certain things change. And this is leading to duplicate notifications.
This works perfectly on iOS.
The text was updated successfully, but these errors were encountered: