-
Notifications
You must be signed in to change notification settings - Fork 592
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
fix(local-notifications): Make getPending not return already fired notifications #256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested and it works, but it adds a ton of complexity and I think using storage.deleteNotification
when the notification fires is enough to not show it on pending and I don't see any side effects on doing that.
The only thing is have in mind that should only be deleted if not repeatable, so probably should be done inside of the rescheduleNotificationIfNeeded
method or make it return a boolean to know if it was rescheduled or not and delete it only if not rescheduled
…team/capacitor-plugins into local-notifications-pending-fired
Thanks - just deleting the notification worked just as well without any issues! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
let's wait for next beta before merging so tests pass again (hopefully)
…team/capacitor-plugins into local-notifications-pending-fired
This PR adds changes to the local-notification plugin to filter out already fired notifications from the getPending notifications call.
Since Capacitor supports Android API 21+, we can't rely on
NotificationManager.getActiveNotifications()
to easily get a list of notifications in the status bar. Instead, this PR sets avisible
flag on each LocalNotification that gets set when a notification is fired, then cleared when a notification is interacted with.fixes: #221