Closed m52go closed 6 years ago
I cannot reproduce - also please use sticky:true
. ongoing
is deprecated.
hi @katzer, thanks for quick turnaround & your ongoing work on this plugin.
were you getting this behavior? i recorded a quick screen grab.
for me, the notification shade closes in every one of these cases:
code running in video above is here: example code. it's literally just a blank project with the plugin added. it uses ionic but i'm not sure that matters.
i've messed around with some native code, compared it to other code to figure out the differences (e.g., red moon has buttons that work both ways), but haven't been able to get to the root of the issue (assuming it is an issue).
for the record, it looks like this happens because getActivity
is designed to close the notification shade whereas getService
and getBroadcast
aren't (source). indeed, i tested, and the shade doesn't close when getActivity
is changed to either one (getService
or getBroadcast
) in getPendingIntentForAction
in Builder.java
.
but of course that screws up the receivers so the events themselves never fire :)
so i'll close this for now. but if this is ever an issue in the future...maybe this could help.
@m52go See c008cc6
@katzer omg it's perfect! you made my WEEK sir!! sending you an email at contact at appplant.
notification clicked --> notification shade closes and app opens --> good. action button clicked --> notification shade closes --> not always good?
especially if the action results in the related notification still showing.
Your Environment
cordova -v
): 7.1.0cordova platform ls
): android 6.3.0Expected Behavior
notification drawer should stay open if action does not result in clearing its notification.
Actual Behavior
notification drawer is closed no matter what: on notification click, action click, etc.
Steps to Reproduce
create new notification with action button. have action button do anything (or nothing), and notification shade will close every time whenever an action button is clicked.
Context
one of my action buttons updates the notification it's attached to. it's confusing for the user if the 'update' action button results in the whole notification shade closing, when they were just looking for the notification to update.
example: android's default sms app ('messages') provides a 'mark as read' action for new text messages. upon clicking that action, the message is marked as read, and the notification shade remains open.